File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1557,10 +1557,10 @@ object Parsers {
15571557 else p
15581558 }
15591559
1560- /** Pattern2 ::= [varid `@'] InfixPattern
1560+ /** Pattern2 ::= [id `@'] InfixPattern
15611561 */
15621562 val pattern2 = () => infixPattern() match {
1563- case p @ Ident (name) if isVarPattern(p) && in.token == AT =>
1563+ case p @ Ident (name) if in.token == AT =>
15641564 val offset = in.skipToken()
15651565
15661566 // compatibility for Scala2 `x @ _*` syntax
Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ CaseClause ::= ‘case’ (Pattern [Guard] ‘=>’ Block | INT)
220220Pattern ::= Pattern1 { ‘|’ Pattern1 } Alternative(pats)
221221Pattern1 ::= PatVar ‘:’ RefinedType Bind(name, Typed(Ident(wildcard), tpe))
222222 | Pattern2
223- Pattern2 ::= [varid ‘@’] InfixPattern Bind(name, pat)
223+ Pattern2 ::= [id ‘@’] InfixPattern Bind(name, pat)
224224InfixPattern ::= SimplePattern { id [nl] SimplePattern } InfixOp(pat, op, pat)
225225SimplePattern ::= PatVar Ident(wildcard)
226226 | Literal Bind(name, Ident(wildcard))
Original file line number Diff line number Diff line change 1+ class Test {
2+ val A @ List () = List ()
3+ val B @ List (), C : List [Int ] = List ()
4+ val D @ List (), E @ List () = List ()
5+ }
You can’t perform that action at this time.
0 commit comments