diff options
Diffstat (limited to 'test/files/pos/java-access-pos')
-rw-r--r-- | test/files/pos/java-access-pos/J.java | 15 | ||||
-rw-r--r-- | test/files/pos/java-access-pos/S1.scala | 67 |
2 files changed, 82 insertions, 0 deletions
diff --git a/test/files/pos/java-access-pos/J.java b/test/files/pos/java-access-pos/J.java new file mode 100644 index 0000000000..b6bc3363a1 --- /dev/null +++ b/test/files/pos/java-access-pos/J.java @@ -0,0 +1,15 @@ +package a.b; + +public abstract class J { + public J() { } + J(int x1) { } + protected J(int x1, int x2) { } + + abstract void packageAbstract(); + protected abstract void protectedAbstract(); + public abstract void publicAbstract(); + + void packageConcrete() { return; } + protected void protectedConcrete() { return; } + public void publicConcrete() { return; } +} 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 |