summaryrefslogtreecommitdiff
path: root/test/files/pos/t8954/t1.scala
diff options
context:
space:
mode:
authorAntoine Gourlay <antoine@gourlay.fr>2014-11-04 15:29:27 +0100
committerAntoine Gourlay <antoine@gourlay.fr>2014-11-06 15:11:36 +0100
commit3bd7605d1870cf1f877c32574b6f82bb20132346 (patch)
treec0ee81026b4b500f36b06b07c83a7cb9238d3342 /test/files/pos/t8954/t1.scala
parentd1a76d5af7faa12ebebea0923812af26c40eebc9 (diff)
downloadscala-3bd7605d1870cf1f877c32574b6f82bb20132346.tar.gz
scala-3bd7605d1870cf1f877c32574b6f82bb20132346.tar.bz2
scala-3bd7605d1870cf1f877c32574b6f82bb20132346.zip
SI-8954 Make @deprecated{Overriding,Inheritance} aware of @deprecated.
This makes sure that: - there is no warning for a @deprecated class inheriting a @deprecatedInheritance class - there is no warning for a @deprecated method overriding a @deprecatedOverriding method - there is no "deprecation won't work" warning when overriding a member of a @deprecatedInheritance class with a @deprecated member - the above works even if the classes/methods are indirectly deprecated (i.e. enclosed in something @deprecated) This should remove quite a few useless deprecation warnings from the library.
Diffstat (limited to 'test/files/pos/t8954/t1.scala')
-rw-r--r--test/files/pos/t8954/t1.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/files/pos/t8954/t1.scala b/test/files/pos/t8954/t1.scala
new file mode 100644
index 0000000000..3986d9f3b5
--- /dev/null
+++ b/test/files/pos/t8954/t1.scala
@@ -0,0 +1,13 @@
+package scala.foo
+
+// 1. a class about to be made final
+@deprecatedInheritance class A {
+ def foo(): Unit = ???
+}
+
+// 1.1:
+// - no inheritance warning because same file
+// - no "override non-deprecated member" because @deprecatedInheritance
+class B2 extends A {
+ @deprecated("","") override def foo(): Unit = ???
+}