-
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.
Make uninitialized
var
syntax a migration warning
* In `future-migration` we emit the deprecation warning * In `future` we emit we make this syntax an error
- Loading branch information
1 parent
1e95432
commit e448e37
Showing
5 changed files
with
30 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- Error: tests/neg/uninitialized-future-migration.scala:7:15 ---------------------------------------------------------- | ||
7 | var a: Int = _ // error | ||
| ^ | ||
| `= _` has been deprecated; use `= uninitialized` instead. | ||
| `uninitialized` can be imported with `scala.compiletime.uninitialized`. |
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` | ||
import scala.compiletime.uninitialized | ||
|
||
class Foo: | ||
var a: Int = _ // error | ||
var b: Int = uninitialized |
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 | ||
import scala.compiletime.uninitialized | ||
|
||
class Foo: | ||
var a: Int = _ // error | ||
var b: Int = uninitialized |
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` | ||
import scala.compiletime.uninitialized | ||
|
||
class Foo: | ||
var a: Int = _ // warn | ||
var b: Int = uninitialized |