diff options
author | Paul Phillips <paulp@improving.org> | 2010-10-26 04:37:09 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-10-26 04:37:09 +0000 |
commit | 22da3636fd531964182c4079e0e17faf2c0f38c8 (patch) | |
tree | ba744515437a17afd80d463eec8435eaa2d47872 /test/files/pos/java-access-pos/S1.scala | |
parent | 7f365342d9875ffc4105af26faa260f81a270246 (diff) | |
download | scala-22da3636fd531964182c4079e0e17faf2c0f38c8.tar.gz scala-22da3636fd531964182c4079e0e17faf2c0f38c8.tar.bz2 scala-22da3636fd531964182c4079e0e17faf2c0f38c8.zip |
A modifier's work is never done.
protected and its bevy of corner cases. Closes #3939, #3947. This patch
is intended for both trunk and 2.8.1. Already reviewed and co-authored
by moors, and review by oderksy.
Diffstat (limited to 'test/files/pos/java-access-pos/S1.scala')
-rw-r--r-- | test/files/pos/java-access-pos/S1.scala | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/test/files/pos/java-access-pos/S1.scala b/test/files/pos/java-access-pos/S1.scala new file mode 100644 index 0000000000..10730e3a70 --- /dev/null +++ b/test/files/pos/java-access-pos/S1.scala @@ -0,0 +1,67 @@ +package a.b + +/** Declaring "override" all the time. + */ +class S1 extends J { + override private[b] def packageAbstract() = () + override protected[b] def protectedAbstract() = () + override def publicAbstract() = () + + override private[b] def packageConcrete() = () + override protected[b] def protectedConcrete() = () + override def publicConcrete() = () +} + +/** Implementing abstracts. + */ +class S2 extends J { + private[b] def packageAbstract() = () + protected[b] def protectedAbstract() = () + def publicAbstract() = () +} + +/** Widening access. + */ +class S3 extends J { + protected[b] def packageAbstract() = () + protected[b] def protectedAbstract() = () + def publicAbstract() = () + + override protected[b] def packageConcrete() = () + override protected[b] def protectedConcrete() = () + override def publicConcrete() = () +} +/** More widening. + */ +class S4 extends J { + private[a] def packageAbstract() = () + protected[a] def protectedAbstract() = () + def publicAbstract() = () + + override private[a] def packageConcrete() = () + override protected[a] def protectedConcrete() = () + override def publicConcrete() = () +} +/** Yet more widening. + */ +class S5 extends J { + def packageAbstract() = () + def protectedAbstract() = () + def publicAbstract() = () + + override def packageConcrete() = () + override def protectedConcrete() = () + override def publicConcrete() = () +} +/** Constructors. + */ +class S6 extends J(1) { + def packageAbstract() = () + def protectedAbstract() = () + def publicAbstract() = () +} +class S7 extends J(1, 2) { + def packageAbstract() = () + def protectedAbstract() = () + def publicAbstract() = () +}
\ No newline at end of file |