diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-02-25 16:16:47 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-02-25 16:16:47 +1000 |
commit | 06e7e342d1e27097df0b9d0b31a322fd1cf0a34e (patch) | |
tree | 8b941248d5a3c795505e39d4f52cdeea3d537819 /test | |
parent | dff479907919f59f35c4efa75e46950d8a239b5b (diff) | |
download | scala-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')
-rw-r--r-- | test/files/run/t9182.check | 3 | ||||
-rw-r--r-- | test/files/run/t9182.scala | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/test/files/run/t9182.check b/test/files/run/t9182.check new file mode 100644 index 0000000000..80e8b6c558 --- /dev/null +++ b/test/files/run/t9182.check @@ -0,0 +1,3 @@ +constructor package +method A +object A 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")) + } +} |