diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t6989.check | 24 | ||||
-rw-r--r-- | test/files/run/t6989/JavaClass_1.java | 7 | ||||
-rw-r--r-- | test/files/run/t6989/Test_2.scala | 23 |
3 files changed, 54 insertions, 0 deletions
diff --git a/test/files/run/t6989.check b/test/files/run/t6989.check new file mode 100644 index 0000000000..06bc3b7200 --- /dev/null +++ b/test/files/run/t6989.check @@ -0,0 +1,24 @@ +============ +class JavaClass_1 +isPrivate = false +isProtected = false +isPublic = false +privateWithin = package foo +============ +variable x +isPrivate = true +isProtected = false +isPublic = false +privateWithin = <none> +============ +variable y +isPrivate = false +isProtected = true +isPublic = false +privateWithin = package foo +============ +variable z +isPrivate = false +isProtected = false +isPublic = true +privateWithin = <none> diff --git a/test/files/run/t6989/JavaClass_1.java b/test/files/run/t6989/JavaClass_1.java new file mode 100644 index 0000000000..61253dfe6f --- /dev/null +++ b/test/files/run/t6989/JavaClass_1.java @@ -0,0 +1,7 @@ +package foo; + +class JavaClass_1 { + private int x = 0; + protected String y = ""; + public float z = 0.0f; +}
\ No newline at end of file diff --git a/test/files/run/t6989/Test_2.scala b/test/files/run/t6989/Test_2.scala new file mode 100644 index 0000000000..ba88e5cce3 --- /dev/null +++ b/test/files/run/t6989/Test_2.scala @@ -0,0 +1,23 @@ +import scala.reflect.runtime.universe._ + +package object foo { + def test(sym: Symbol) = { + println("============") + println(sym) + println(s"isPrivate = ${sym.isPrivate}") + println(s"isProtected = ${sym.isProtected}") + println(s"isPublic = ${sym.isPublic}") + println(s"privateWithin = ${sym.privateWithin}") + } + + def testAll() = { + test(typeOf[foo.JavaClass_1].typeSymbol) + test(typeOf[foo.JavaClass_1].declaration(newTermName("x"))) + test(typeOf[foo.JavaClass_1].declaration(newTermName("y"))) + test(typeOf[foo.JavaClass_1].declaration(newTermName("z"))) + } +} + +object Test extends App { + foo.testAll() +}
\ No newline at end of file |