aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/parsing
diff options
context:
space:
mode:
authorMiron Aseev <aseev.miron@gmail.com>2016-11-11 02:44:51 +0700
committerMiron Aseev <aseev.miron@gmail.com>2016-11-14 19:21:34 +0700
commit759dcf3f903a75fccfcb9e5039e537f8f08a4858 (patch)
treefcab9a040499e1d952c5a6212c8e90be164c96b8 /src/dotty/tools/dotc/parsing
parent816fbd0d4cf6cefc93e02e4cf5bd067c517eea48 (diff)
downloaddotty-759dcf3f903a75fccfcb9e5039e537f8f08a4858.tar.gz
dotty-759dcf3f903a75fccfcb9e5039e537f8f08a4858.tar.bz2
dotty-759dcf3f903a75fccfcb9e5039e537f8f08a4858.zip
Add an error message for incorrect sequence wildcard pattern position
Diffstat (limited to 'src/dotty/tools/dotc/parsing')
-rw-r--r--src/dotty/tools/dotc/parsing/Parsers.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/parsing/Parsers.scala b/src/dotty/tools/dotc/parsing/Parsers.scala
index ef4c970c6..717faa849 100644
--- a/src/dotty/tools/dotc/parsing/Parsers.scala
+++ b/src/dotty/tools/dotc/parsing/Parsers.scala
@@ -1076,7 +1076,7 @@ object Parsers {
val uscoreStart = in.skipToken()
if (isIdent(nme.raw.STAR)) {
in.nextToken()
- if (in.token != RPAREN) syntaxError("`_*' can be used only for last argument", uscoreStart)
+ if (in.token != RPAREN) syntaxError(SeqWildcardPatternPos(), uscoreStart)
Typed(t, atPos(uscoreStart) { Ident(tpnme.WILDCARD_STAR) })
} else {
syntaxErrorOrIncomplete(IncorrectRepeatedParameterSyntax())
@@ -1424,7 +1424,7 @@ object Parsers {
// `x: _*' is parsed in `ascription'
if (isIdent(nme.raw.STAR)) {
in.nextToken()
- if (in.token != RPAREN) syntaxError("`_*' can be used only for last argument", wildIndent.pos)
+ if (in.token != RPAREN) syntaxError(SeqWildcardPatternPos(), wildIndent.pos)
atPos(wildIndent.pos) { Ident(tpnme.WILDCARD_STAR) }
} else wildIndent
case LPAREN =>