summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/reflect/scala/reflect/runtime/SymbolLoaders.scala3
-rw-r--r--test/files/run/t9182.check3
-rw-r--r--test/files/run/t9182.scala12
3 files changed, 17 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/runtime/SymbolLoaders.scala b/src/reflect/scala/reflect/runtime/SymbolLoaders.scala
index 50ea8d9868..9ce6331e33 100644
--- a/src/reflect/scala/reflect/runtime/SymbolLoaders.scala
+++ b/src/reflect/scala/reflect/runtime/SymbolLoaders.scala
@@ -107,7 +107,8 @@ private[reflect] trait SymbolLoaders { self: SymbolTable =>
if (isCompilerUniverse) super.enter(sym)
else {
val existing = super.lookupEntry(sym.name)
- assert(existing == null || existing.sym.isMethod, s"pkgClass = $pkgClass, sym = $sym, existing = $existing")
+ def eitherIsMethod(sym1: Symbol, sym2: Symbol) = sym1.isMethod || sym2.isMethod
+ assert(existing == null || eitherIsMethod(existing.sym, sym), s"pkgClass = $pkgClass, sym = $sym, existing = $existing")
super.enter(sym)
}
}
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"))
+ }
+}