diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Definitions.scala | 4 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Erasure.scala | 8 |
3 files changed, 8 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala index 283b381d5f..1c0dae7ab8 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala @@ -69,7 +69,7 @@ abstract class GenJVM extends SubComponent { */ class BytecodeGenerator { val MIN_SWITCH_DENSITY = 0.7 - val StringBuilderClass = "scala.StringBuilder" + val StringBuilderClass = definitions.getClass2("scala.StringBuilder", "scala.collection.mutable.StringBuilder").fullNameString val BoxesRunTime = "scala.runtime.BoxesRunTime" val StringBuilderType = new JObjectType(StringBuilderClass) diff --git a/src/compiler/scala/tools/nsc/symtab/Definitions.scala b/src/compiler/scala/tools/nsc/symtab/Definitions.scala index 559f3f5890..727cd16d20 100644 --- a/src/compiler/scala/tools/nsc/symtab/Definitions.scala +++ b/src/compiler/scala/tools/nsc/symtab/Definitions.scala @@ -283,8 +283,8 @@ trait Definitions { def seqType(arg: Type) = typeRef(SeqClass.typeConstructor.prefix, SeqClass, List(arg)) - def NilModule: Symbol = getModule2("scala.Nil", "scala.collection.immutable.Nil") - def ConsClass: Symbol = getClass2("scala.$colon$colon", "scala.collection.immutable.$colon$colon") + lazy val NilModule: Symbol = getModule2("scala.Nil", "scala.collection.immutable.Nil") + lazy val ConsClass: Symbol = getClass2("scala.$colon$colon", "scala.collection.immutable.$colon$colon") // members of class scala.Any var Any_== : Symbol = _ diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala index 7485e4ae66..3ff464bf97 100644 --- a/src/compiler/scala/tools/nsc/transform/Erasure.scala +++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala @@ -647,9 +647,11 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer { tree.symbol = NoSymbol else if (qual1.tpe.isInstanceOf[MethodType] && qual1.tpe.paramTypes.isEmpty) { assert(qual1.symbol.isStable, qual1.symbol); - qual1 = Apply(qual1, List()) setPos qual1.pos setType qual1.tpe.resultType; - } else if (!(qual1.isInstanceOf[Super] || (qual1.tpe.typeSymbol isSubClass tree.symbol.owner))) - qual1 = cast(qual1, tree.symbol.owner.tpe); + qual1 = Apply(qual1, List()) setPos qual1.pos setType qual1.tpe.resultType + } else if (!(qual1.isInstanceOf[Super] || (qual1.tpe.typeSymbol isSubClass tree.symbol.owner))) { + // println("member cast "+tree.symbol+" "+tree.symbol.ownerChain+" "+qual1+" "+qual1.tpe) + qual1 = cast(qual1, tree.symbol.owner.tpe) + } copy.Select(tree, qual1, name) } case _ => |