File tree 1 file changed +6
-2
lines changed
src/dotty/tools/dotc/transform 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ package transform
4
4
import TreeTransforms ._
5
5
import core .DenotTransformers ._
6
6
import core .Symbols ._
7
+ import core .SymDenotations ._
7
8
import core .Contexts ._
8
9
import core .Types ._
9
10
import core .Flags ._
@@ -75,9 +76,12 @@ class ElimByName extends MiniPhaseTransform with InfoTransformer { thisTransform
75
76
cpy.Apply (tree)(tree.fun, args1)
76
77
}
77
78
79
+ private def becomesFunction (symd : SymDenotation )(implicit ctx : Context ) =
80
+ (symd is Param ) || (symd is (ParamAccessor , butNot = Method ))
81
+
78
82
override def transformIdent (tree : Ident )(implicit ctx : Context , info : TransformerInfo ): Tree = {
79
83
val origDenot = originalDenotation(tree)
80
- if ((origDenot is Param ) && (origDenot.info.isInstanceOf [ExprType ]))
84
+ if (becomesFunction (origDenot) && (origDenot.info.isInstanceOf [ExprType ]))
81
85
tree.select(defn.Function0_apply ).appliedToNone
82
86
else tree
83
87
}
@@ -98,6 +102,6 @@ class ElimByName extends MiniPhaseTransform with InfoTransformer { thisTransform
98
102
}
99
103
100
104
def transformInfo (tp : Type , sym : Symbol )(implicit ctx : Context ): Type =
101
- if (sym is Param ) transformParamInfo(tp)
105
+ if (becomesFunction( sym) ) transformParamInfo(tp)
102
106
else elimByNameParams(tp)
103
107
}
You can’t perform that action at this time.
0 commit comments