diff options
author | Antoine Gourlay <antoine@gourlay.fr> | 2014-08-28 10:40:05 +0200 |
---|---|---|
committer | Antoine Gourlay <antoine@gourlay.fr> | 2014-08-28 10:59:53 +0200 |
commit | 997ef56058d8c44d2b9c5f561edf2aa65221c150 (patch) | |
tree | 9d11fc54c0b13a9e58978c8baad0557421bb8175 /test/files/pos | |
parent | 7693cecc8b3cf56984a041bb2d7979e2a040314a (diff) | |
download | scala-997ef56058d8c44d2b9c5f561edf2aa65221c150.tar.gz scala-997ef56058d8c44d2b9c5f561edf2aa65221c150.tar.bz2 scala-997ef56058d8c44d2b9c5f561edf2aa65221c150.zip |
SI-8828 fix regression in Xlint visibility warning for sealed classes
5dfcf5e reverted a change to `Symbol#isEffectivelyFinal` (made in
adeffda) that broke overriding checks, and moved the new enhanced
version to a new method.
However, the test for inaccessible type access still uses the old one,
so it lost the ability to see that the owner of some method is either
final or sealed and not overridden.
This just makes it use the new `isEffectivelyFinalOrNotOverriden`.
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/t8828.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t8828.scala | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/test/files/pos/t8828.flags b/test/files/pos/t8828.flags new file mode 100644 index 0000000000..e68991f643 --- /dev/null +++ b/test/files/pos/t8828.flags @@ -0,0 +1 @@ +-Xlint:inaccessible -Xfatal-warnings diff --git a/test/files/pos/t8828.scala b/test/files/pos/t8828.scala new file mode 100644 index 0000000000..92092b4dd4 --- /dev/null +++ b/test/files/pos/t8828.scala @@ -0,0 +1,20 @@ + +package outer + +package inner { + + private[inner] class A + + // the class is final: no warning + private[outer] final class B { + def doWork(a: A): A = a + } + + // the trait is sealed and doWork is not + // and cannot be overriden: no warning + private[outer] sealed trait C { + def doWork(a: A): A = a + } + + private[outer] final class D extends C +} |