File tree 2 files changed +3
-8
lines changed 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,8 @@ class Definitions {
221
221
222
222
lazy val Predef_conformsR = ScalaPredefModule .requiredMethodRef(" $conforms" )
223
223
def Predef_conforms (implicit ctx : Context ) = Predef_conformsR .symbol
224
+ lazy val Predef_classOfR = ScalaPredefModule .requiredMethodRef(" classOf" )
225
+ def Predef_classOf (implicit ctx : Context ) = Predef_classOfR .symbol
224
226
225
227
lazy val ScalaRuntimeModuleRef = ctx.requiredModuleRef(" scala.runtime.ScalaRunTime" )
226
228
def ScalaRuntimeModule (implicit ctx : Context ) = ScalaRuntimeModuleRef .symbol
Original file line number Diff line number Diff line change @@ -21,15 +21,8 @@ class ClassOf extends MiniPhaseTransform {
21
21
22
22
override def phaseName : String = " classOf"
23
23
24
- private var classOfMethod : TermSymbol = _
25
-
26
- override def prepareForUnit (tree : tpd.Tree )(implicit ctx : Context ): TreeTransform = {
27
- classOfMethod = defn.ScalaPredefModule .requiredMethod(nme.classOf )
28
- this
29
- }
30
-
31
24
override def transformTypeApply (tree : TypeApply )(implicit ctx : Context , info : TransformerInfo ): Tree =
32
- if (tree.symbol eq classOfMethod ) {
25
+ if (tree.symbol eq defn. Predef_classOf ) {
33
26
val targ = tree.args.head.tpe
34
27
clsOf(targ).ensureConforms(tree.tpe).withPos(tree.pos)
35
28
}
You can’t perform that action at this time.
0 commit comments