diff options
author | Adriaan Moors <adriaan@lightbend.com> | 2017-02-22 17:26:59 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-22 17:26:59 -0800 |
commit | 86cd70f396b4087052ac6afb7c6ed68c2a30a61f (patch) | |
tree | a4759a782fad30d75c27b9dc1bdd0f1230729837 /src | |
parent | cbf7daa57d70ccacf8cfc7c2f4a7c0e81e1c773a (diff) | |
download | scala-86cd70f396b4087052ac6afb7c6ed68c2a30a61f.tar.gz scala-86cd70f396b4087052ac6afb7c6ed68c2a30a61f.tar.bz2 scala-86cd70f396b4087052ac6afb7c6ed68c2a30a61f.zip |
Revert "Fix erasure of the qualifier of ##"
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Erasure.scala | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala index f8f0c193e2..e327a6658c 100644 --- a/src/compiler/scala/tools/nsc/transform/Erasure.scala +++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala @@ -1064,21 +1064,20 @@ abstract class Erasure extends InfoTransform } else if (args.isEmpty && interceptedMethods(fn.symbol)) { if (poundPoundMethods.contains(fn.symbol)) { - val qual1 = preErase(qual) // This is unattractive, but without it we crash here on ().## because after // erasure the ScalaRunTime.hash overload goes from Unit => Int to BoxedUnit => Int. // This must be because some earlier transformation is being skipped on ##, but so // far I don't know what. For null we now define null.## == 0. def staticsCall(methodName: TermName): Tree = { - val newTree = gen.mkMethodCall(RuntimeStaticsModule, methodName, qual1 :: Nil) + val newTree = gen.mkMethodCall(RuntimeStaticsModule, methodName, qual :: Nil) global.typer.typed(newTree) } - qual1.tpe.typeSymbol match { - case UnitClass | NullClass => BLOCK(qual1, LIT(0)) - case IntClass => qual1 - case s @ (ShortClass | ByteClass | CharClass) => numericConversion(qual1, s) - case BooleanClass => If(qual1, LIT(true.##), LIT(false.##)) + qual.tpe.typeSymbol match { + case UnitClass | NullClass => LIT(0) + case IntClass => qual + case s @ (ShortClass | ByteClass | CharClass) => numericConversion(qual, s) + case BooleanClass => If(qual, LIT(true.##), LIT(false.##)) case LongClass => staticsCall(nme.longHash) case FloatClass => staticsCall(nme.floatHash) case DoubleClass => staticsCall(nme.doubleHash) |