@@ -1502,7 +1502,7 @@ object Parsers {
1502
1502
def typedFunParam (start : Offset , name : TermName , mods : Modifiers = EmptyModifiers ): ValDef =
1503
1503
atSpan(start) {
1504
1504
accept(COLON )
1505
- makeParameter(name, typ(), mods)
1505
+ makeParameter(name, typ(), mods | Param )
1506
1506
}
1507
1507
1508
1508
/** FunParamClause ::= ‘(’ TypedFunParam {‘,’ TypedFunParam } ‘)’
@@ -1864,14 +1864,14 @@ object Parsers {
1864
1864
accept(altToken)
1865
1865
t
1866
1866
1867
- /** Expr ::= [`implicit'] FunParams ‘=>’ Expr
1867
+ /** Expr ::= [`implicit'] FunParams ( ‘=>’ | ‘?=>’) Expr
1868
1868
* | Expr1
1869
1869
* FunParams ::= Bindings
1870
1870
* | id
1871
1871
* | `_'
1872
1872
* ExprInParens ::= PostfixExpr `:' Type
1873
1873
* | Expr
1874
- * BlockResult ::= [‘implicit’] FunParams ‘=>’ Block
1874
+ * BlockResult ::= [‘implicit’] FunParams ( ‘=>’ | ‘?=>’) Block
1875
1875
* | Expr1
1876
1876
* Expr1 ::= [‘inline’] `if' `(' Expr `)' {nl} Expr [[semi] else Expr]
1877
1877
* | [‘inline’] `if' Expr `then' Expr [[semi] else Expr]
@@ -2186,7 +2186,7 @@ object Parsers {
2186
2186
2187
2187
def closureRest (start : Int , location : Location , params : List [Tree ]): Tree =
2188
2188
atSpan(start, in.offset) {
2189
- accept(ARROW )
2189
+ if in.token == CTXARROW then in.nextToken() else accept(ARROW )
2190
2190
Function (params, if (location == Location .InBlock ) block() else expr())
2191
2191
}
2192
2192
@@ -3773,7 +3773,7 @@ object Parsers {
3773
3773
case Typed (tree @ This (EmptyTypeIdent ), tpt) =>
3774
3774
self = makeSelfDef(nme.WILDCARD , tpt).withSpan(first.span)
3775
3775
case _ =>
3776
- val ValDef (name, tpt, _) = convertToParam(first, " self type clause" )
3776
+ val ValDef (name, tpt, _) = convertToParam(first, EmptyModifiers , " self type clause" )
3777
3777
if (name != nme.ERROR )
3778
3778
self = makeSelfDef(name, tpt).withSpan(first.span)
3779
3779
}
0 commit comments