diff options
author | Paolo G. Giarrusso <p.giarrusso@gmail.com> | 2013-03-16 02:07:42 +0100 |
---|---|---|
committer | Paolo G. Giarrusso <p.giarrusso@gmail.com> | 2013-03-16 02:07:42 +0100 |
commit | b0560c5ece29ad9d3f79ad6389b085a2a83fbe18 (patch) | |
tree | 7fafbdf69c62ae3ebd5c1cbfe9805ce21b7193b1 | |
parent | 386a5bd68de3a95563d61b2b305e012c157f3b89 (diff) | |
download | scala-b0560c5ece29ad9d3f79ad6389b085a2a83fbe18.tar.gz scala-b0560c5ece29ad9d3f79ad6389b085a2a83fbe18.tar.bz2 scala-b0560c5ece29ad9d3f79ad6389b085a2a83fbe18.zip |
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.
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala | 3 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala | 3 |
2 files changed, 2 insertions, 4 deletions
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 |