File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -3565,6 +3565,9 @@ object Parsers {
3565
3565
val tparams = typeParamClauseOpt(ParamOwner .Def )
3566
3566
val extParams = paramClause(0 , prefix = true )
3567
3567
val givenParamss = paramClauses(givenOnly = true )
3568
+ if in.token == COLON then
3569
+ syntaxError(" no `:` expected here" )
3570
+ in.nextToken()
3568
3571
val methods =
3569
3572
if isDefIntro(modifierTokens) then
3570
3573
extMethod() :: Nil
Original file line number Diff line number Diff line change
1
+ -- Error: tests/neg/extension-colon.scala:1:18 -------------------------------------------------------------------------
2
+ 1 |extension (x: Int): // error
3
+ | ^
4
+ | no `:` expected here
Original file line number Diff line number Diff line change
1
+ extension (x : Int ): // error
2
+ def foo = x
You can’t perform that action at this time.
0 commit comments