-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecation warnings for old syntax:
_
type wildcards
* In `3.4` we emit the deprecation warning and enable the patch with `-rewrite`. * In `future` we emit we make this syntax an error
- Loading branch information
1 parent
f61026d
commit 7f26941
Showing
9 changed files
with
39 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
//> using options -source:future -deprecation | ||
//> using options -source:future-migration | ||
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: -------------------------------------------------------- | ||
-- Migration Warning: ---------------------------------------------------------- | ||
1 | type N[X] = X match { case List[_] => Int } | ||
| ^ | ||
| `_` is deprecated for wildcard arguments of types: use `?` instead | ||
| `_` is deprecated for wildcard arguments of types: use `?` instead |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- Error: tests/neg/wildcard-type-syntax-future-migration.scala:7:17 --------------------------------------------------- | ||
7 | case _: List[_] => // error | ||
| ^ | ||
| `_` is deprecated for wildcard arguments of types: use `?` instead | ||
| This construct can be rewritten automatically under -rewrite -source future-migration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//> using options -Werror | ||
|
||
import scala.language.`future-migration` | ||
|
||
def test = | ||
Seq() match | ||
case _: List[_] => // error | ||
case _: Seq[?] => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import scala.language.future | ||
|
||
def test = | ||
Seq() match | ||
case _: List[_] => // error | ||
case _: Seq[?] => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import scala.language.`future-migration` | ||
|
||
def test = | ||
Seq() match | ||
case _: List[_] => // warn | ||
case _: Seq[?] => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//> using options -Werror | ||
|
||
def test = | ||
Seq() match | ||
case _: List[_] => // error | ||
case _: Seq[?] => |