File tree 1 file changed +8
-1
lines changed
src/compiler/scala/tools/nsc/transform 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1102,7 +1102,14 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL {
1102
1102
// add forwarders
1103
1103
assert(sym.alias != NoSymbol , sym)
1104
1104
// debuglog("New forwarder: " + sym.defString + " => " + sym.alias.defString)
1105
- if (! sym.isMacro) addDefDef(sym, Apply (staticRef(sym.alias), gen.mkAttributedThis(clazz) :: sym.paramss.head.map(Ident )))
1105
+ if (! sym.isMacro) {
1106
+ val rhs =
1107
+ enteringPickler(sym.info) match {
1108
+ case ct : ConstantType => gen.mkAttributedQualifier(ct) // don't call forwarder if it's just going to return a literal
1109
+ case _ => Apply (staticRef(sym.alias), gen.mkAttributedThis(clazz) :: sym.paramss.head.map(Ident ))
1110
+ }
1111
+ addDefDef(sym, rhs)
1112
+ }
1106
1113
}
1107
1114
}
1108
1115
}
You can’t perform that action at this time.
0 commit comments