-
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
private[this]
a migration warning
* In `future-migration` 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
1e95432
commit 96f88a0
Showing
10 changed files
with
66 additions
and
6 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
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,10 @@ | ||
-- Error: tests/neg/private-this-future-migration.scala:6:16 ----------------------------------------------------------- | ||
6 | private[this] def foo: Int = ??? // error | ||
| ^ | ||
| The [this] qualifier will be deprecated in the future; it should be dropped. | ||
| This construct can be rewritten automatically under -rewrite -source future-migration. | ||
-- Error: tests/neg/private-this-future-migration.scala:7:18 ----------------------------------------------------------- | ||
7 | protected[this] def bar: Int = ??? // error | ||
| ^ | ||
| The [this] qualifier will be deprecated in the future; it should be dropped. | ||
| 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,7 @@ | ||
//> using options -Werror | ||
|
||
import scala.language.`future-migration` | ||
|
||
class Foo: | ||
private[this] def foo: Int = ??? // error | ||
protected[this] def bar: Int = ??? // error |
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 @@ | ||
import scala.language.future | ||
|
||
class Foo: | ||
private[this] def foo: Int = ??? // error | ||
protected[this] def bar: Int = ??? // error |
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 @@ | ||
import scala.language.`future-migration` | ||
|
||
class Foo: | ||
private[this] def foo: Int = ??? // warn | ||
protected[this] def bar: Int = ??? // warn |
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,3 @@ | ||
class Foo: | ||
private[this] def foo: Int = ??? | ||
protected[this] def bar: Int = ??? |
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,12 @@ | ||
class Foo: | ||
private def foo1: Int = ??? | ||
private def foo2: Int = ??? | ||
private def foo3: Int = ??? | ||
private def foo4: Int = ??? | ||
private def foo5: Int = ??? | ||
|
||
protected def bar1: Int = ??? | ||
protected def bar2: Int = ??? | ||
protected def bar3: Int = ??? | ||
protected def bar4: Int = ??? | ||
protected def bar5: Int = ??? |
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,12 @@ | ||
class Foo: | ||
private[this] def foo1: Int = ??? | ||
private[ this] def foo2: Int = ??? | ||
private[this ] def foo3: Int = ??? | ||
private[ this ] def foo4: Int = ??? | ||
private [this] def foo5: Int = ??? | ||
|
||
protected[this] def bar1: Int = ??? | ||
protected[ this] def bar2: Int = ??? | ||
protected[this ] def bar3: Int = ??? | ||
protected[ this ] def bar4: Int = ??? | ||
protected [this] def bar5: Int = ??? |