File tree 2 files changed +21
-15
lines changed
compiler/src/dotty/tools/dotc/parsing
2 files changed +21
-15
lines changed Original file line number Diff line number Diff line change @@ -1809,22 +1809,15 @@ object Parsers {
1809
1809
NamedArg (name.toTypeName, argType())
1810
1810
}
1811
1811
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
- }
1821
1812
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
+ }
1828
1821
}
1829
1822
else commaSeparated(() => argType())
1830
1823
}
Original file line number Diff line number Diff line change @@ -85,6 +85,19 @@ trait FunTypeParamClause {
85
85
A ,
86
86
B ,
87
87
]: 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
+ ]
88
101
}
89
102
90
103
trait SimpleType {
You can’t perform that action at this time.
0 commit comments