@@ -883,25 +883,22 @@ abstract class BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
883
883
*
884
884
* must-single-thread
885
885
*/
886
- private def addForwarder (isRemoteClass : Boolean , jclass : asm.ClassVisitor , module : Symbol , m : Symbol ): Unit = {
887
- def staticForwarderGenericSignature (sym : Symbol , moduleClass : Symbol ): String = {
888
- if (sym.isDeferred) null // only add generic signature if method concrete; bug #1745
889
- else {
890
- // SI-3452 Static forwarder generation uses the same erased signature as the method if forwards to.
891
- // By rights, it should use the signature as-seen-from the module class, and add suitable
892
- // primitive and value-class boxing/unboxing.
893
- // But for now, just like we did in mixin, we just avoid writing a wrong generic signature
894
- // (one that doesn't erase to the actual signature). See run/t3452b for a test case.
895
- val memberTpe = enteringErasure(moduleClass.thisType.memberInfo(sym))
896
- val erasedMemberType = erasure.erasure(sym)(memberTpe)
897
- if (erasedMemberType =:= sym.info)
898
- getGenericSignature(sym, moduleClass, memberTpe)
899
- else null
900
- }
886
+ private def addForwarder (isRemoteClass : Boolean , jclass : asm.ClassVisitor , moduleClass : Symbol , m : Symbol ): Unit = {
887
+ def staticForwarderGenericSignature : String = {
888
+ // SI-3452 Static forwarder generation uses the same erased signature as the method if forwards to.
889
+ // By rights, it should use the signature as-seen-from the module class, and add suitable
890
+ // primitive and value-class boxing/unboxing.
891
+ // But for now, just like we did in mixin, we just avoid writing a wrong generic signature
892
+ // (one that doesn't erase to the actual signature). See run/t3452b for a test case.
893
+ val memberTpe = enteringErasure(moduleClass.thisType.memberInfo(m))
894
+ val erasedMemberType = erasure.erasure(m)(memberTpe)
895
+ if (erasedMemberType =:= m.info)
896
+ getGenericSignature(m, moduleClass, memberTpe)
897
+ else null
901
898
}
902
899
903
- val moduleName = internalName(module )
904
- val methodInfo = module .thisType.memberInfo(m)
900
+ val moduleName = internalName(moduleClass )
901
+ val methodInfo = moduleClass .thisType.memberInfo(m)
905
902
val paramJavaTypes : List [BType ] = methodInfo.paramTypes map typeToBType
906
903
// val paramNames = 0 until paramJavaTypes.length map ("x_" + _)
907
904
@@ -916,7 +913,7 @@ abstract class BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
916
913
)
917
914
918
915
// TODO needed? for(ann <- m.annotations) { ann.symbol.initialize }
919
- val jgensig = staticForwarderGenericSignature(m, module)
916
+ val jgensig = staticForwarderGenericSignature
920
917
addRemoteExceptionAnnot(isRemoteClass, hasPublicBitSet(flags), m)
921
918
val (throws, others) = m.annotations partition (_.symbol == definitions.ThrowsClass )
922
919
val thrownExceptions : List [String ] = getExceptions(throws)
@@ -937,7 +934,7 @@ abstract class BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
937
934
938
935
mirrorMethod.visitCode()
939
936
940
- mirrorMethod.visitFieldInsn(asm.Opcodes .GETSTATIC , moduleName, strMODULE_INSTANCE_FIELD, classBTypeFromSymbol(module ).descriptor)
937
+ mirrorMethod.visitFieldInsn(asm.Opcodes .GETSTATIC , moduleName, strMODULE_INSTANCE_FIELD, classBTypeFromSymbol(moduleClass ).descriptor)
941
938
942
939
var index = 0
943
940
for (jparamType <- paramJavaTypes) {
0 commit comments