File tree Expand file tree Collapse file tree 2 files changed +21
-15
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 2 files changed +21
-15
lines changed Original file line number Diff line number Diff line change @@ -1809,22 +1809,15 @@ object Parsers {
18091809 NamedArg (name.toTypeName, argType())
18101810 }
18111811
1812- def otherArgs (first : Tree , arg : () => Tree ): List [Tree ] = {
1813- val rest =
1814- if (in.token == COMMA ) {
1815- in.nextToken()
1816- commaSeparated(arg)
1817- }
1818- else Nil
1819- first :: rest
1820- }
18211812 if (namedOK && in.token == IDENTIFIER )
1822- argType() match {
1823- case Ident (name) if in.token == EQUALS =>
1824- in.nextToken()
1825- otherArgs(NamedArg (name, argType()), () => namedTypeArg())
1826- case firstArg =>
1827- otherArgs(firstArg, () => argType())
1813+ in.currentRegion.withCommasExpected {
1814+ argType() match {
1815+ case Ident (name) if in.token == EQUALS =>
1816+ in.nextToken()
1817+ commaSeparatedRest(NamedArg (name, argType()), () => namedTypeArg())
1818+ case firstArg =>
1819+ commaSeparatedRest(firstArg, () => argType())
1820+ }
18281821 }
18291822 else commaSeparated(() => argType())
18301823 }
Original file line number Diff line number Diff line change @@ -85,6 +85,19 @@ trait FunTypeParamClause {
8585 A ,
8686 B ,
8787 ]: Unit
88+
89+ def f1 [
90+ A ,
91+ ]: Unit
92+
93+ def g : Unit = f[
94+ Int ,
95+ String ,
96+ ]
97+
98+ def g1 : Unit = f1[
99+ Int ,
100+ ]
88101}
89102
90103trait SimpleType {
You can’t perform that action at this time.
0 commit comments