We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ab44759 + 300f2cc commit a6df9caCopy full SHA for a6df9ca
compiler/src/dotty/tools/dotc/parsing/Parsers.scala
@@ -4012,7 +4012,7 @@ object Parsers {
4012
val tparams = typeParamClauseOpt(ParamOwner.Given)
4013
newLineOpt()
4014
val vparamss =
4015
- if in.token == LPAREN && in.lookahead.isIdent(nme.using)
+ if in.token == LPAREN && (in.lookahead.isIdent(nme.using) || name != EmptyTermName)
4016
then termParamClauses(ParamOwner.Given)
4017
else Nil
4018
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