File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed
src/compiler/scala/tools/nsc/ast/parser Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -2197,13 +2197,10 @@ self =>
2197
2197
*/
2198
2198
def pattern1 (): Tree = pattern2() match {
2199
2199
case p @ Ident (name) if in.token == COLON =>
2200
- if (nme.isVariableName(name)) {
2201
- p.removeAttachment[BackquotedIdentifierAttachment .type ]
2202
- atPos(p.pos.start, in.skipToken())(Typed (p, compoundType()))
2203
- } else {
2204
- syntaxError(in.offset, " Pattern variables must start with a lower-case letter. (SLS 8.1.1.)" )
2205
- p
2206
- }
2200
+ if (! nme.isVariableName(name))
2201
+ syntaxError(p.pos.point, " Pattern variables must start with a lower-case letter. (SLS 8.1.1.)" )
2202
+ p.removeAttachment[BackquotedIdentifierAttachment .type ]
2203
+ atPos(p.pos.start, in.skipToken())(Typed (p, compoundType()))
2207
2204
case p => p
2208
2205
}
2209
2206
Original file line number Diff line number Diff line change 1
1
t5357.scala:5: error: Pattern variables must start with a lower-case letter. (SLS 8.1.1.)
2
2
case A: N => 1
3
- ^
3
+ ^
4
4
1 error
Original file line number Diff line number Diff line change 1
1
t8044-b.scala:3: error: Pattern variables must start with a lower-case letter. (SLS 8.1.1.)
2
2
def g = 42 match { case `Oops` : Int => } // must be varish
3
- ^
3
+ ^
4
4
1 error
You can’t perform that action at this time.
0 commit comments