@@ -42,15 +42,16 @@ class ElimByName extends TransformByNameApply with InfoTransformer { thisTransfo
42
42
43
43
override def phaseName : String = " elimByName"
44
44
45
- // override def treeTransformPhase(implicit ctx: Context, info: TransformerInfo) =
46
- // groupEndPhase
45
+ override def treeTransformPhase (implicit ctx : Context , info : TransformerInfo ) =
46
+ groupEndPhase
47
47
48
48
override def runsAfterGroupsOf = Set (classOf [Splitter ])
49
49
// I got errors running this phase in an earlier group, but I did not track them down.
50
50
51
51
/** Map `tree` to `tree.apply()` is `ftree` was of ExprType and becomes now a function */
52
52
private def applyIfFunction (tree : Tree , ftree : Tree )(implicit ctx : Context ) =
53
- if (isByNameRef(ftree)) tree.select(defn.Function0_apply ).appliedToNone
53
+ if (isByNameRef(ftree))
54
+ ctx.atPhase(next) { implicit ctx => tree.select(defn.Function0_apply ).appliedToNone }
54
55
else tree
55
56
56
57
override def transformIdent (tree : Ident )(implicit ctx : Context , info : TransformerInfo ): Tree =
@@ -68,9 +69,11 @@ class ElimByName extends TransformByNameApply with InfoTransformer { thisTransfo
68
69
}
69
70
70
71
override def transformValDef (tree : ValDef )(implicit ctx : Context , info : TransformerInfo ): Tree =
71
- if (exprBecomesFunction(tree.symbol))
72
- cpy.ValDef (tree)(tpt = tree.tpt.withType(tree.symbol.info))
73
- else tree
72
+ ctx.atPhase(next) { implicit ctx =>
73
+ if (exprBecomesFunction(tree.symbol))
74
+ cpy.ValDef (tree)(tpt = tree.tpt.withType(tree.symbol.info))
75
+ else tree
76
+ }
74
77
75
78
def transformInfo (tp : Type , sym : Symbol )(implicit ctx : Context ): Type = tp match {
76
79
case ExprType (rt) if exprBecomesFunction(sym) => defn.FunctionOf (Nil , rt)
0 commit comments