@@ -1502,7 +1502,7 @@ object Parsers {
15021502 def typedFunParam (start : Offset , name : TermName , mods : Modifiers = EmptyModifiers ): ValDef =
15031503 atSpan(start) {
15041504 accept(COLON )
1505- makeParameter(name, typ(), mods)
1505+ makeParameter(name, typ(), mods | Param )
15061506 }
15071507
15081508 /** FunParamClause ::= ‘(’ TypedFunParam {‘,’ TypedFunParam } ‘)’
@@ -1864,14 +1864,14 @@ object Parsers {
18641864 accept(altToken)
18651865 t
18661866
1867- /** Expr ::= [`implicit'] FunParams ‘=>’ Expr
1867+ /** Expr ::= [`implicit'] FunParams ( ‘=>’ | ‘?=>’) Expr
18681868 * | Expr1
18691869 * FunParams ::= Bindings
18701870 * | id
18711871 * | `_'
18721872 * ExprInParens ::= PostfixExpr `:' Type
18731873 * | Expr
1874- * BlockResult ::= [‘implicit’] FunParams ‘=>’ Block
1874+ * BlockResult ::= [‘implicit’] FunParams ( ‘=>’ | ‘?=>’) Block
18751875 * | Expr1
18761876 * Expr1 ::= [‘inline’] `if' `(' Expr `)' {nl} Expr [[semi] else Expr]
18771877 * | [‘inline’] `if' Expr `then' Expr [[semi] else Expr]
@@ -2186,7 +2186,7 @@ object Parsers {
21862186
21872187 def closureRest (start : Int , location : Location , params : List [Tree ]): Tree =
21882188 atSpan(start, in.offset) {
2189- accept(ARROW )
2189+ if in.token == CTXARROW then in.nextToken() else accept(ARROW )
21902190 Function (params, if (location == Location .InBlock ) block() else expr())
21912191 }
21922192
@@ -3773,7 +3773,7 @@ object Parsers {
37733773 case Typed (tree @ This (EmptyTypeIdent ), tpt) =>
37743774 self = makeSelfDef(nme.WILDCARD , tpt).withSpan(first.span)
37753775 case _ =>
3776- val ValDef (name, tpt, _) = convertToParam(first, " self type clause" )
3776+ val ValDef (name, tpt, _) = convertToParam(first, EmptyModifiers , " self type clause" )
37773777 if (name != nme.ERROR )
37783778 self = makeSelfDef(name, tpt).withSpan(first.span)
37793779 }
0 commit comments