-
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.
Backport "Add support for @deprecatedInheritance" to LTS (#20805)
Backports #19082 to the LTS branch. PR submitted by the release tooling. [skip ci]
- Loading branch information
Showing
13 changed files
with
108 additions
and
46 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
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
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 |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import scala.collection.mutable | ||
|
||
class Translater: | ||
val count = new mutable.HashMap[Int, Int] { | ||
override def default(key: Int) = 0 | ||
} | ||
val count = new mutable.HashMap[Int, Int].withDefaultValue(0) | ||
count.get(10) | ||
val n = 10 |
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,36 @@ | ||
-- Deprecation Warning: tests/warn/i19002.scala:5:20 ------------------------------------------------------------------- | ||
5 |class TBar1 extends TFoo // warn | ||
| ^^^^ | ||
| inheritance from trait TFoo is deprecated (since: FooLib 12.0): this class will be made final | ||
-- Deprecation Warning: tests/warn/i19002.scala:6:20 ------------------------------------------------------------------- | ||
6 |trait TBar2 extends TFoo // warn | ||
| ^^^^ | ||
| inheritance from trait TFoo is deprecated (since: FooLib 12.0): this class will be made final | ||
-- Deprecation Warning: tests/warn/i19002.scala:11:20 ------------------------------------------------------------------ | ||
11 |class CBar1 extends CFoo // warn | ||
| ^^^^ | ||
| inheritance from class CFoo is deprecated (since: FooLib 11.0) | ||
-- Deprecation Warning: tests/warn/i19002.scala:12:20 ------------------------------------------------------------------ | ||
12 |trait CBar2 extends CFoo // warn | ||
| ^^^^ | ||
| inheritance from class CFoo is deprecated (since: FooLib 11.0) | ||
-- Deprecation Warning: tests/warn/i19002.scala:17:20 ------------------------------------------------------------------ | ||
17 |class ABar1 extends AFoo // warn | ||
| ^^^^ | ||
| inheritance from class AFoo is deprecated: this class will be made final | ||
-- Deprecation Warning: tests/warn/i19002.scala:18:20 ------------------------------------------------------------------ | ||
18 |trait ABar2 extends AFoo // warn | ||
| ^^^^ | ||
| inheritance from class AFoo is deprecated: this class will be made final | ||
-- Deprecation Warning: tests/warn/i19002.scala:7:16 ------------------------------------------------------------------- | ||
7 |def TBar3 = new TFoo {} // warn | ||
| ^^^^ | ||
| inheritance from trait TFoo is deprecated (since: FooLib 12.0): this class will be made final | ||
-- Deprecation Warning: tests/warn/i19002.scala:13:16 ------------------------------------------------------------------ | ||
13 |def CBar3 = new CFoo {} // warn | ||
| ^^^^ | ||
| inheritance from class CFoo is deprecated (since: FooLib 11.0) | ||
-- Deprecation Warning: tests/warn/i19002.scala:19:16 ------------------------------------------------------------------ | ||
19 |def ABar3 = new AFoo {} // warn | ||
| ^^^^ | ||
| inheritance from class AFoo is deprecated: this class will be made final |
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,23 @@ | ||
//> using options -deprecation | ||
|
||
@deprecatedInheritance("this class will be made final", "FooLib 12.0") | ||
trait TFoo | ||
class TBar1 extends TFoo // warn | ||
trait TBar2 extends TFoo // warn | ||
def TBar3 = new TFoo {} // warn | ||
|
||
@deprecatedInheritance(since = "FooLib 11.0") | ||
class CFoo | ||
class CBar1 extends CFoo // warn | ||
trait CBar2 extends CFoo // warn | ||
def CBar3 = new CFoo {} // warn | ||
|
||
@deprecatedInheritance(message = "this class will be made final") | ||
abstract class AFoo | ||
class ABar1 extends AFoo // warn | ||
trait ABar2 extends AFoo // warn | ||
def ABar3 = new AFoo {} // warn | ||
|
||
@deprecated | ||
class DeprecatedFoo: | ||
class Foo extends AFoo // it shoudln't warn here (in deprecated context) |