diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-04-15 19:00:29 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-04-15 19:00:29 -0700 |
commit | e337bfca56572b88dbc75a0e5d20f862be5f4ce0 (patch) | |
tree | e78dfa660dc4ddfebc0a7e9755fbf77530b067fc /test/files | |
parent | 835fbfb152f8f806639473a96883e002bd8706c4 (diff) | |
parent | 660c8fd4c89c4f7121d131138c5f9fceaefa4992 (diff) | |
download | scala-e337bfca56572b88dbc75a0e5d20f862be5f4ce0.tar.gz scala-e337bfca56572b88dbc75a0e5d20f862be5f4ce0.tar.bz2 scala-e337bfca56572b88dbc75a0e5d20f862be5f4ce0.zip |
Merge pull request #2336 from retronym/topic/deprecated-inheritance-tweak
SI-7312 @deprecatedInheritance now ignores same-file subclasses
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/t6162-inheritance.check | 10 | ||||
-rw-r--r-- | test/files/neg/t6162-inheritance/defn.scala | 10 | ||||
-rw-r--r-- | test/files/neg/t6162-inheritance/usage.scala | 10 | ||||
-rw-r--r-- | test/files/pos/t6162-inheritance.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t6162-inheritance.scala (renamed from test/files/neg/t6162-inheritance.scala) | 3 | ||||
-rw-r--r-- | test/files/pos/t7315.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t7315.scala | 4 |
7 files changed, 34 insertions, 5 deletions
diff --git a/test/files/neg/t6162-inheritance.check b/test/files/neg/t6162-inheritance.check index e98fa79eb7..13c78030d9 100644 --- a/test/files/neg/t6162-inheritance.check +++ b/test/files/neg/t6162-inheritance.check @@ -1,16 +1,16 @@ -t6162-inheritance.scala:6: warning: inheritance from class Foo in package t6126 is deprecated: `Foo` will be made final in a future version. +usage.scala:3: warning: inheritance from class Foo in package t6126 is deprecated: `Foo` will be made final in a future version. class SubFoo extends Foo ^ -t6162-inheritance.scala:11: warning: inheritance from trait T in package t6126 is deprecated +usage.scala:5: warning: inheritance from trait T in package t6126 is deprecated object SubT extends T ^ -t6162-inheritance.scala:17: warning: inheritance from trait S in package t6126 is deprecated +usage.scala:8: warning: inheritance from trait S in package t6126 is deprecated new S { ^ -t6162-inheritance.scala:6: warning: inheritance from class Foo in package t6126 is deprecated: `Foo` will be made final in a future version. +usage.scala:3: warning: inheritance from class Foo in package t6126 is deprecated: `Foo` will be made final in a future version. class SubFoo extends Foo ^ -t6162-inheritance.scala:11: warning: inheritance from trait T in package t6126 is deprecated +usage.scala:5: warning: inheritance from trait T in package t6126 is deprecated object SubT extends T ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t6162-inheritance/defn.scala b/test/files/neg/t6162-inheritance/defn.scala new file mode 100644 index 0000000000..bb582d27b0 --- /dev/null +++ b/test/files/neg/t6162-inheritance/defn.scala @@ -0,0 +1,10 @@ +package scala.t6126 + +@deprecatedInheritance("`Foo` will be made final in a future version.", "2.10.0") +class Foo + +@deprecatedInheritance() +trait T + +@deprecatedInheritance() +trait S diff --git a/test/files/neg/t6162-inheritance/usage.scala b/test/files/neg/t6162-inheritance/usage.scala new file mode 100644 index 0000000000..097e4f5903 --- /dev/null +++ b/test/files/neg/t6162-inheritance/usage.scala @@ -0,0 +1,10 @@ +package scala.t6126 + +class SubFoo extends Foo + +object SubT extends T + +object O { + new S { + } +} diff --git a/test/files/pos/t6162-inheritance.flags b/test/files/pos/t6162-inheritance.flags new file mode 100644 index 0000000000..c6bfaf1f64 --- /dev/null +++ b/test/files/pos/t6162-inheritance.flags @@ -0,0 +1 @@ +-deprecation -Xfatal-warnings diff --git a/test/files/neg/t6162-inheritance.scala b/test/files/pos/t6162-inheritance.scala index 7b47b9285a..fca751edab 100644 --- a/test/files/neg/t6162-inheritance.scala +++ b/test/files/pos/t6162-inheritance.scala @@ -1,5 +1,8 @@ package scala.t6126 +// Don't warn about inheritance in the same file. +// We might use that as a prelude to sealing a class. + @deprecatedInheritance("`Foo` will be made final in a future version.", "2.10.0") class Foo diff --git a/test/files/pos/t7315.flags b/test/files/pos/t7315.flags new file mode 100644 index 0000000000..d1b831ea87 --- /dev/null +++ b/test/files/pos/t7315.flags @@ -0,0 +1 @@ +-deprecation -Xfatal-warnings
\ No newline at end of file diff --git a/test/files/pos/t7315.scala b/test/files/pos/t7315.scala new file mode 100644 index 0000000000..0abcea2451 --- /dev/null +++ b/test/files/pos/t7315.scala @@ -0,0 +1,4 @@ +package scala.pack + +@deprecatedInheritance +class C[@specialized A]
\ No newline at end of file |