diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index c845ea8f74c7..95ada2670cab 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -1860,9 +1860,6 @@ object Parsers { val start = in.skipToken() Ident(tpnme.USCOREkw).withSpan(Span(start, in.lastOffset, start)) else - if sourceVersion.isAtLeast(future) then - deprecationWarning(em"`_` is deprecated for wildcard arguments of types: use `?` instead") - patch(source, Span(in.offset, in.offset + 1), "?") val start = in.skipToken() typeBounds().withSpan(Span(start, in.lastOffset, start)) // Allow symbols -_ and +_ through for compatibility with code written using kind-projector in Scala 3 underscore mode. diff --git a/compiler/test-resources/repl/i13208.scala b/compiler/test-resources/repl/i13208.scala index 61ace43c732d..890116b6a247 100644 --- a/compiler/test-resources/repl/i13208.scala +++ b/compiler/test-resources/repl/i13208.scala @@ -1,8 +1,3 @@ //> using options -source:future -deprecation scala> type M[X] = X match { case Int => String case _ => Int } -scala> type N[X] = X match { case List[_] => Int } -1 warning found --- Deprecation Warning: -------------------------------------------------------- -1 | type N[X] = X match { case List[_] => Int } - | ^ - | `_` is deprecated for wildcard arguments of types: use `?` instead +scala> type N[X] = X match { case List[_] => Int } \ No newline at end of file diff --git a/tests/pos-with-compiler-cc/dotc/parsing/Parsers.scala b/tests/pos-with-compiler-cc/dotc/parsing/Parsers.scala index 5024f2f9e366..83692f4a9c43 100644 --- a/tests/pos-with-compiler-cc/dotc/parsing/Parsers.scala +++ b/tests/pos-with-compiler-cc/dotc/parsing/Parsers.scala @@ -1730,9 +1730,6 @@ object Parsers { val start = in.skipToken() Ident(tpnme.USCOREkw).withSpan(Span(start, in.lastOffset, start)) else - if sourceVersion.isAtLeast(future) then - deprecationWarning(em"`_` is deprecated for wildcard arguments of types: use `?` instead") - patch(source, Span(in.offset, in.offset + 1), "?") val start = in.skipToken() typeBounds().withSpan(Span(start, in.lastOffset, start)) // Allow symbols -_ and +_ through for compatibility with code written using kind-projector in Scala 3 underscore mode. diff --git a/tests/pos/i18808.scala b/tests/pos/i18808.scala new file mode 100644 index 000000000000..c17a3dbb67c3 --- /dev/null +++ b/tests/pos/i18808.scala @@ -0,0 +1,8 @@ +//> using options -Werror +import language.future + +type F[X] = X match + case List[_] => Int + +type G[X] = X match + case List[?] => Int \ No newline at end of file