summaryrefslogtreecommitdiff
path: root/test/files/run/t6989
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2013-01-31 11:49:19 +0100
committerEugene Burmako <xeno.by@gmail.com>2013-02-04 22:41:39 +0100
commit02ed5fb3bc8d792872223ceecfd8fd0ae089d923 (patch)
tree9cffc064d77e94b1d3a577ade5ace0e1e4a6cc7f /test/files/run/t6989
parent2fa859e1b3eb2ac57058feaba87d96adfbac9209 (diff)
downloadscala-02ed5fb3bc8d792872223ceecfd8fd0ae089d923.tar.gz
scala-02ed5fb3bc8d792872223ceecfd8fd0ae089d923.tar.bz2
scala-02ed5fb3bc8d792872223ceecfd8fd0ae089d923.zip
SI-6989 privateWithin is now populated in reflect
Runtime reflection in JavaMirrors previously forgot to fill in privateWithin when importing Java reflection artifacts. Now this is fixed.
Diffstat (limited to 'test/files/run/t6989')
-rw-r--r--test/files/run/t6989/JavaClass_1.java7
-rw-r--r--test/files/run/t6989/Test_2.scala23
2 files changed, 30 insertions, 0 deletions
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