diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2009-06-18 16:03:47 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2009-06-18 16:03:47 +0000 |
commit | 57ac948b1bb9240e26b7d4419ef0433a7eaa1c86 (patch) | |
tree | 462467273b526475cd7a3e52b7288b732e32534d /src/compiler | |
parent | 9e52f5beda632d12e439997d4a7d3a5a36e4ea9a (diff) | |
download | scala-57ac948b1bb9240e26b7d4419ef0433a7eaa1c86.tar.gz scala-57ac948b1bb9240e26b7d4419ef0433a7eaa1c86.tar.bz2 scala-57ac948b1bb9240e26b7d4419ef0433a7eaa1c86.zip |
Small fixes in code generation for interface ca...
Small fixes in code generation for interface calls.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/icode/GenICode.scala | 4 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala index 564d4ea36b..134c0e3999 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala @@ -610,7 +610,7 @@ abstract class GenICode extends SubComponent { ctx1.bb.emit(CONSTANT(Constant(false))) } else if (r.isValueType && cast) { - assert(false) /* Erasure should have added an unboxing operation to prevent that. */ + assert(false, tree) /* Erasure should have added an unboxing operation to prevent that. */ } else if (r.isValueType) ctx.bb.emit(IS_INSTANCE(REFERENCE(definitions.boxedClass(r.toType.typeSymbol)))) @@ -651,7 +651,7 @@ abstract class GenICode extends SubComponent { assert(ctor.isClassConstructor, "'new' call to non-constructor: " + ctor.name) - generatedType = toTypeKind(fun.tpe.resultType) + generatedType = toTypeKind(tpt.tpe) if (settings.debug.value) assert(generatedType.isReferenceType || generatedType.isArrayType, "Non reference type cannot be instantiated: " + generatedType) diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala index ef2d98a053..9d33585ff2 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala @@ -1700,7 +1700,12 @@ abstract class GenJVM extends SubComponent { /** Calls to methods in 'sym' need invokeinterface? */ def needsInterfaceCall(sym: Symbol): Boolean = { - sym.info // needed so that the type is up to date (erasure may add lateINTERFACE to traits) + log("checking for interface call: " + sym.fullNameString) + // the following call to 'info' may cause certain symbols to fail loading because we're + // too late in the compilation chain (aliases to overloaded symbols will not be properly + // resolved, see scala.Range, method super$++ that fails in UnPickler at LazyTypeRefAndAlias.complete + if (sym.isTrait) sym.info // needed so that the type is up to date (erasure may add lateINTERFACE to traits) + sym.hasFlag(Flags.INTERFACE) || (sym.hasFlag(Flags.JAVA) && sym.isNonBottomSubClass(definitions.ClassfileAnnotationClass)) |