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 {
35653565 val tparams = typeParamClauseOpt(ParamOwner .Def )
35663566 val extParams = paramClause(0 , prefix = true )
35673567 val givenParamss = paramClauses(givenOnly = true )
3568+ if in.token == COLON then
3569+ syntaxError(" no `:` expected here" )
3570+ in.nextToken()
35683571 val methods =
35693572 if isDefIntro(modifierTokens) then
35703573 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