@@ -60,7 +60,10 @@ class Constructors extends MiniPhaseTransform with SymTransformer { thisTransfor
60
60
61
61
tree match {
62
62
case Ident (_) | Select (This (_), _) =>
63
- def inConstructor = ctx.owner.enclosingMethod.isPrimaryConstructor && ctx.owner.enclosingClass == owner
63
+ def inConstructor = {
64
+ val method = ctx.owner.enclosingMethod
65
+ method.isPrimaryConstructor && ctx.owner.enclosingClass == owner
66
+ }
64
67
if (inConstructor && (sym.is(ParamAccessor ) || seenPrivateVals.contains(sym))) {
65
68
// used inside constructor, accessed on this,
66
69
// could use constructor argument instead, no need to retain field
@@ -131,6 +134,8 @@ class Constructors extends MiniPhaseTransform with SymTransformer { thisTransfor
131
134
132
135
override def transformTemplate (tree : Template )(implicit ctx : Context , info : TransformerInfo ): Tree = {
133
136
val cls = ctx.owner.asClass
137
+ if (cls.toString.contains(" VarianceChecker" ))
138
+ println(" hoho" )
134
139
val constr @ DefDef (nme.CONSTRUCTOR , Nil , vparams :: Nil , _, EmptyTree ) = tree.constr
135
140
136
141
// Produce aligned accessors and constructor parameters. We have to adjust
@@ -298,6 +303,8 @@ class Constructors extends MiniPhaseTransform with SymTransformer { thisTransfor
298
303
cls.copy(
299
304
info = clsInfo.derivedClassInfo(
300
305
decls = clsInfo.decls.filteredScope(! dropped.contains(_))))
306
+
307
+ // TODO: this happens to work only because Constructors is the last phase in group
301
308
}
302
309
303
310
val (superCalls, followConstrStats) = constrStats.toList match {
0 commit comments