@@ -3384,7 +3384,7 @@ object Parsers {
33843384 }
33853385
33863386 /** GivenDef ::= [GivenSig (‘:’ | <:)] Type ‘=’ Expr
3387- * | [GivenSig ‘:’] [ConstrApp {‘,’ ConstrApp }] [[‘with’] TemplateBody]
3387+ * | [GivenSig ‘:’] ConstrApps [[‘with’] TemplateBody]
33883388 * | [id ‘:’] ‘extension’ ExtParamClause {GivenParamClause} ExtMethods
33893389 * GivenSig ::= [id] [DefTypeParamClause] {GivenParamClause}
33903390 * ExtParamClause ::= [DefTypeParamClause] DefParamClause {GivenParamClause}
@@ -3433,24 +3433,20 @@ object Parsers {
34333433 val parents =
34343434 if in.token == COLON then
34353435 in.nextToken()
3436- if in.token == LBRACE
3437- || in.token == WITH
3438- || in.token == LBRACKET
3439- || in.token == LPAREN && followingIsParamOrGivenType()
3436+ if in.token == LBRACKET
3437+ || in.token == LPAREN && followingIsParamOrGivenType()
34403438 then
34413439 parseParams(isExtension = true )
34423440 Nil
34433441 else
3444- tokenSeparated( COMMA , constrApp )
3442+ constrApps(commaOK = true , templateCanFollow = true )
34453443 else if in.token == SUBTYPE then
34463444 if ! mods.is(Inline ) then
34473445 syntaxError(" `<:' is only allowed for given with `inline' modifier" )
34483446 in.nextToken()
34493447 TypeBoundsTree (EmptyTree , toplevelTyp()) :: Nil
3450- else if name.isEmpty
3451- && in.token != LBRACE && in.token != WITH
3452- && ! hasExtensionParams
3453- then tokenSeparated(COMMA , constrApp)
3448+ else if name.isEmpty && ! hasExtensionParams then
3449+ constrApps(commaOK = true , templateCanFollow = true )
34543450 else Nil
34553451
34563452 if in.token == EQUALS && parents.length == 1 && parents.head.isType then
0 commit comments