diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 101871a547d6..ac16c00d14af 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -3119,7 +3119,7 @@ object Parsers { def wildcardSelector() = if in.token == USCORE && sourceVersion.isAtLeast(future) then report.errorOrMigrationWarning( - em"`_` is no longer supported for a wildcard import; use `*` instead${rewriteNotice("3.1")}", + em"`_` is no longer supported for a wildcard import; use `*` instead${rewriteNotice("future")}", in.sourcePos()) patch(source, Span(in.offset, in.offset + 1), "*") ImportSelector(atSpan(in.skipToken()) { Ident(nme.WILDCARD) }) @@ -3137,7 +3137,7 @@ object Parsers { if in.token == ARROW || isIdent(nme.as) then if in.token == ARROW && sourceVersion.isAtLeast(future) then report.errorOrMigrationWarning( - em"The import renaming `a => b` is no longer supported ; use `a as b` instead${rewriteNotice("3.1")}", + em"The import renaming `a => b` is no longer supported ; use `a as b` instead${rewriteNotice("future")}", in.sourcePos()) patch(source, Span(in.offset, in.offset + 2), if testChar(in.offset - 1, ' ') && testChar(in.offset + 2, ' ') then "as" diff --git a/tests/neg/i11487.check b/tests/neg/i11487.check new file mode 100644 index 000000000000..885b330fd970 --- /dev/null +++ b/tests/neg/i11487.check @@ -0,0 +1,5 @@ +-- Error: tests/neg/i11487.scala:2:13 ---------------------------------------------------------------------------------- +2 |import scala._ // error + | ^ + | `_` is no longer supported for a wildcard import; use `*` instead + | This construct can be rewritten automatically under -rewrite -source future-migration. diff --git a/tests/neg/i11487.scala b/tests/neg/i11487.scala new file mode 100644 index 000000000000..db44ec5b9c1d --- /dev/null +++ b/tests/neg/i11487.scala @@ -0,0 +1,4 @@ +import language.future +import scala._ // error + +object Test \ No newline at end of file