Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/parsing/Parsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3958,7 +3958,7 @@ object Parsers {
val tparams = typeParamClauseOpt(ParamOwner.Given)
newLineOpt()
val vparamss =
if in.token == LPAREN && in.lookahead.isIdent(nme.using)
if in.token == LPAREN && (in.lookahead.isIdent(nme.using) || name != EmptyTermName)
then termParamClauses(ParamOwner.Given)
else Nil
newLinesOpt()
Expand Down
11 changes: 11 additions & 0 deletions tests/neg/i19402.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
object Test:

class Bar(foo: Foo)

class Foo

given (Foo) = ???
given (using a: Int): Int = ???
given [T](using a: T): T = ???
given bar(foo: Foo): Bar = Bar(foo) // error: using is expected