diff options
Diffstat (limited to 'sources/scalac/ast')
-rw-r--r-- | sources/scalac/ast/parser/Parser.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sources/scalac/ast/parser/Parser.java b/sources/scalac/ast/parser/Parser.java index b5aa598f23..d5b3522367 100644 --- a/sources/scalac/ast/parser/Parser.java +++ b/sources/scalac/ast/parser/Parser.java @@ -1123,7 +1123,7 @@ public class Parser implements Tokens { /** TreePattern ::= varid `:' Type1 * | `_' `:' Type1 * | SimplePattern [ '*' | '?' | '+' ] - * | SimplePattern {Id SimplePattern} + * | SimplePattern {Id SimplePattern} // op2 must not be empty */ Tree treePattern() { int base = sp; @@ -1175,6 +1175,9 @@ public class Parser implements Tokens { push(top, s.pos, s.name); ident(); top = simplePattern(); + if( TreeInfo.isEmptySequence( top ) ) { + syntaxError( top.pos, "empty sequence not allowed here", false); + } } return reduceStack(false, base, top, 0, true); } |