@@ -2310,7 +2310,7 @@ object Parsers {
2310
2310
possibleTemplateStart()
2311
2311
val parents =
2312
2312
if in.isNestedStart then Nil
2313
- else constrApps(commaOK = false , templateCanFollow = true )
2313
+ else constrApps(commaOK = false )
2314
2314
colonAtEOLOpt()
2315
2315
possibleTemplateStart(isNew = true )
2316
2316
parents match {
@@ -3493,7 +3493,7 @@ object Parsers {
3493
3493
val parents =
3494
3494
if (in.token == EXTENDS ) {
3495
3495
in.nextToken()
3496
- constrApps(commaOK = true , templateCanFollow = false )
3496
+ constrApps(commaOK = true )
3497
3497
}
3498
3498
else Nil
3499
3499
Template (constr, parents, Nil , EmptyValDef , Nil )
@@ -3537,7 +3537,7 @@ object Parsers {
3537
3537
val noParams = tparams.isEmpty && vparamss.isEmpty
3538
3538
if ! (name.isEmpty && noParams) then
3539
3539
accept(nme.as)
3540
- val parents = constrApps(commaOK = true , templateCanFollow = true )
3540
+ val parents = constrApps(commaOK = true )
3541
3541
if in.token == EQUALS && parents.length == 1 && parents.head.isType then
3542
3542
accept(EQUALS )
3543
3543
mods1 |= Final
@@ -3617,19 +3617,12 @@ object Parsers {
3617
3617
3618
3618
/** ConstrApps ::= ConstrApp {(‘,’ | ‘with’) ConstrApp}
3619
3619
*/
3620
- def constrApps (commaOK : Boolean , templateCanFollow : Boolean ): List [Tree ] =
3620
+ def constrApps (commaOK : Boolean ): List [Tree ] =
3621
3621
val t = constrApp()
3622
3622
val ts =
3623
- if in.token == WITH then
3623
+ if in.token == WITH || commaOK && in.token == COMMA then
3624
3624
in.nextToken()
3625
- newLineOptWhenFollowedBy(LBRACE )
3626
- if templateCanFollow && (in.token == LBRACE || in.token == INDENT ) then
3627
- Nil
3628
- else
3629
- constrApps(commaOK, templateCanFollow)
3630
- else if commaOK && in.token == COMMA then
3631
- in.nextToken()
3632
- constrApps(commaOK, templateCanFollow)
3625
+ constrApps(commaOK)
3633
3626
else Nil
3634
3627
t :: ts
3635
3628
@@ -3646,7 +3639,7 @@ object Parsers {
3646
3639
in.sourcePos())
3647
3640
Nil
3648
3641
}
3649
- else constrApps(commaOK = true , templateCanFollow = true )
3642
+ else constrApps(commaOK = true )
3650
3643
}
3651
3644
else Nil
3652
3645
newLinesOptWhenFollowedBy(nme.derives )
0 commit comments