From b0560c5ece29ad9d3f79ad6389b085a2a83fbe18 Mon Sep 17 00:00:00 2001 From: "Paolo G. Giarrusso" Date: Sat, 16 Mar 2013 02:07:42 +0100 Subject: Remove fragile code, made redundant by previous commit The JLS requires, as an exception to generate calls referring to Object for all methods defined in Object itself; hence, whenever the method owner is Object, the call should refer to the method owner. The previous commit implemented this directly in useMethodOwner, so the special case for Object in isInterfaceCall is now redudant. Hence, remove it. --- src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala | 3 +-- src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala index 55b20154de..0995111688 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala @@ -2260,8 +2260,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM { hostSymbol.info ; methodOwner.info def isInterfaceCall(sym: Symbol) = ( - //XXX remove the test for ObjectClass. - sym.isInterface && methodOwner != ObjectClass + sym.isInterface || sym.isJavaDefined && sym.isNonBottomSubClass(ClassfileAnnotationClass) ) // whether to reference the type of the receiver or diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala index ed0d8144ca..11d46d9ae7 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala @@ -1197,8 +1197,7 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid with hostSymbol.info ; methodOwner.info def isInterfaceCall(sym: Symbol) = ( - //XXX remove the test for ObjectClass. - sym.isInterface && methodOwner != ObjectClass + sym.isInterface || sym.isJavaDefined && sym.isNonBottomSubClass(ClassfileAnnotationClass) ) // whether to reference the type of the receiver or -- cgit v1.2.3