summaryrefslogtreecommitdiff
path: root/test/files/run/t9182.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-02-25 16:16:47 +1000
committerJason Zaugg <jzaugg@gmail.com>2015-02-25 16:16:47 +1000
commit06e7e342d1e27097df0b9d0b31a322fd1cf0a34e (patch)
tree8b941248d5a3c795505e39d4f52cdeea3d537819 /test/files/run/t9182.scala
parentdff479907919f59f35c4efa75e46950d8a239b5b (diff)
downloadscala-06e7e342d1e27097df0b9d0b31a322fd1cf0a34e.tar.gz
scala-06e7e342d1e27097df0b9d0b31a322fd1cf0a34e.tar.bz2
scala-06e7e342d1e27097df0b9d0b31a322fd1cf0a34e.zip
SI-9182 Fix runtime reflection with package object, overloads
Eponymous modules and methods should be allowed to live in the same package scope. This can happen when using a module and and implicit class, or when defining the overloads manually. This commit tones back an assertion that was added for sanity checking runtime reflection thread safety to only fire when we are sure that neither the existing and current symbol of the given name are methods.
Diffstat (limited to 'test/files/run/t9182.scala')
-rw-r--r--test/files/run/t9182.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/files/run/t9182.scala b/test/files/run/t9182.scala
new file mode 100644
index 0000000000..1768aa688e
--- /dev/null
+++ b/test/files/run/t9182.scala
@@ -0,0 +1,12 @@
+// Main.scala
+package object ops {
+ object A
+ def A(a: Any) = ()
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val pack = scala.reflect.runtime.currentMirror.staticModule("ops.package")
+ println(pack.info.decls.toList.map(_.toString).sorted.mkString("\n"))
+ }
+}