@@ -1064,20 +1064,21 @@ abstract class Erasure extends InfoTransform
1064
1064
}
1065
1065
else if (args.isEmpty && interceptedMethods(fn.symbol)) {
1066
1066
if (poundPoundMethods.contains(fn.symbol)) {
1067
+ val qual1 = preErase(qual)
1067
1068
// This is unattractive, but without it we crash here on ().## because after
1068
1069
// erasure the ScalaRunTime.hash overload goes from Unit => Int to BoxedUnit => Int.
1069
1070
// This must be because some earlier transformation is being skipped on ##, but so
1070
1071
// far I don't know what. For null we now define null.## == 0.
1071
1072
def staticsCall(methodName: TermName): Tree = {
1072
- val newTree = gen.mkMethodCall(RuntimeStaticsModule, methodName, qual :: Nil)
1073
+ val newTree = gen.mkMethodCall(RuntimeStaticsModule, methodName, qual1 :: Nil)
1073
1074
global.typer.typed(newTree)
1074
1075
}
1075
1076
1076
- qual .tpe.typeSymbol match {
1077
- case UnitClass | NullClass => LIT(0)
1078
- case IntClass => qual
1079
- case s @ (ShortClass | ByteClass | CharClass) => numericConversion(qual , s)
1080
- case BooleanClass => If(qual , LIT(true.##), LIT(false.##))
1077
+ qual1 .tpe.typeSymbol match {
1078
+ case UnitClass | NullClass => BLOCK(qual1, LIT(0) )
1079
+ case IntClass => qual1
1080
+ case s @ (ShortClass | ByteClass | CharClass) => numericConversion(qual1 , s)
1081
+ case BooleanClass => If(qual1 , LIT(true.##), LIT(false.##))
1081
1082
case LongClass => staticsCall(nme.longHash)
1082
1083
case FloatClass => staticsCall(nme.floatHash)
1083
1084
case DoubleClass => staticsCall(nme.doubleHash)
0 commit comments