@@ -983,9 +983,15 @@ object Parsers {
983983 }
984984 else
985985 val t = reduceStack(base, top, minPrec, leftAssoc = true , in.name, isType)
986- if ! isType && in.token == MATCH then recur (matchClause(t))
986+ if ! isType && in.token == MATCH then recurAtMinPrec (matchClause(t))
987987 else t
988988
989+ def recurAtMinPrec (top : Tree ): Tree =
990+ if isIdent && isOperator && precedence(in.name) == minInfixPrec
991+ || in.token == MATCH
992+ then recur(top)
993+ else top
994+
989995 recur(first)
990996 }
991997
@@ -2758,8 +2764,8 @@ object Parsers {
27582764 /** OLD: GivenTypes ::= AnnotType {‘,’ AnnotType}
27592765 * NEW: GivenTypes ::= Type {‘,’ Type}
27602766 */
2761- def givenTypes (newStyle : Boolean , nparams : Int , ofClass : Boolean ): List [ValDef ] =
2762- val tps = commaSeparated(() => if newStyle then typ() else annotType() )
2767+ def givenTypes (nparams : Int , ofClass : Boolean ): List [ValDef ] =
2768+ val tps = commaSeparated(typ)
27632769 var counter = nparams
27642770 def nextIdx = { counter += 1 ; counter }
27652771 val paramFlags = if ofClass then Private | Local | ParamAccessor else Param
@@ -2862,7 +2868,7 @@ object Parsers {
28622868 || startParamTokens.contains(in.token)
28632869 || isIdent && (in.name == nme.inline || in.lookaheadIn(BitSet (COLON )))
28642870 if isParams then commaSeparated(() => param())
2865- else givenTypes(true , nparams, ofClass)
2871+ else givenTypes(nparams, ofClass)
28662872 checkVarArgsRules(clause)
28672873 clause
28682874 }
0 commit comments