diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala index 197c95d4d6..c48bfa8a09 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala @@ -713,13 +713,16 @@ abstract class GenJVM extends SubComponent { javaType(field)) case LOAD_MODULE(module) => - assert(module.isModule || module.isModuleClass, "Expected module: " + module) +// assert(module.isModule, "Expected module: " + module) if (settings.debug.value) log("genearting LOAD_MODULE for: " + module + " flags: " + Flags.flagsToString(module.flags)); - jcode.emitGETSTATIC(javaName(module) /* + "$" */ , - nme.MODULE_INSTANCE_FIELD.toString, - javaType(module)); + if (clasz.symbol == module.moduleClass) + jcode.emitALOAD_0() + else + jcode.emitGETSTATIC(javaName(module) /* + "$" */ , + nme.MODULE_INSTANCE_FIELD.toString, + javaType(module)); case STORE_ARRAY_ITEM(kind) => jcode.emitASTORE(javaType(kind)) |