We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 017a250 + 977dc5d commit 644bc4fCopy full SHA for 644bc4f
compiler/src/dotty/tools/dotc/parsing/Parsers.scala
@@ -3958,7 +3958,7 @@ object Parsers {
3958
val tparams = typeParamClauseOpt(ParamOwner.Given)
3959
newLineOpt()
3960
val vparamss =
3961
- if in.token == LPAREN && in.lookahead.isIdent(nme.using)
+ if in.token == LPAREN && (in.lookahead.isIdent(nme.using) || name != EmptyTermName)
3962
then termParamClauses(ParamOwner.Given)
3963
else Nil
3964
newLinesOpt()
tests/neg/i19402.scala
@@ -0,0 +1,11 @@
1
+object Test:
2
+
3
+ class Bar(foo: Foo)
4
5
+ class Foo
6
7
+ given (Foo) = ???
8
+ given (using a: Int): Int = ???
9
+ given [T](using a: T): T = ???
10
+ given bar(foo: Foo): Bar = Bar(foo) // error: using is expected
11
0 commit comments