Skip to content

Commit 93e2359

Browse files
authored
Merge pull request #11517 from dotty-staging/fix-11487
Fix source version in migration message
2 parents 7920e70 + e684de9 commit 93e2359

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3119,7 +3119,7 @@ object Parsers {
31193119
def wildcardSelector() =
31203120
if in.token == USCORE && sourceVersion.isAtLeast(future) then
31213121
report.errorOrMigrationWarning(
3122-
em"`_` is no longer supported for a wildcard import; use `*` instead${rewriteNotice("3.1")}",
3122+
em"`_` is no longer supported for a wildcard import; use `*` instead${rewriteNotice("future")}",
31233123
in.sourcePos())
31243124
patch(source, Span(in.offset, in.offset + 1), "*")
31253125
ImportSelector(atSpan(in.skipToken()) { Ident(nme.WILDCARD) })
@@ -3137,7 +3137,7 @@ object Parsers {
31373137
if in.token == ARROW || isIdent(nme.as) then
31383138
if in.token == ARROW && sourceVersion.isAtLeast(future) then
31393139
report.errorOrMigrationWarning(
3140-
em"The import renaming `a => b` is no longer supported ; use `a as b` instead${rewriteNotice("3.1")}",
3140+
em"The import renaming `a => b` is no longer supported ; use `a as b` instead${rewriteNotice("future")}",
31413141
in.sourcePos())
31423142
patch(source, Span(in.offset, in.offset + 2),
31433143
if testChar(in.offset - 1, ' ') && testChar(in.offset + 2, ' ') then "as"

tests/neg/i11487.check

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-- Error: tests/neg/i11487.scala:2:13 ----------------------------------------------------------------------------------
2+
2 |import scala._ // error
3+
| ^
4+
| `_` is no longer supported for a wildcard import; use `*` instead
5+
| This construct can be rewritten automatically under -rewrite -source future-migration.

tests/neg/i11487.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import language.future
2+
import scala._ // error
3+
4+
object Test

0 commit comments

Comments
 (0)