@@ -41,9 +41,8 @@ class Constructors extends MiniPhaseTransform with SymTransformer { thisTransfor
41
41
// 3. It is accessed on an object other than `this`
42
42
// 4. It is a mutable parameter accessor
43
43
// 5. It is has a wildcard initializer `_`
44
- private var retainedPrivateVals = mutable.Set [Symbol ]()
45
- private var seenPrivateVals = mutable.Set [Symbol ]()
46
- private var insideConstructor = false
44
+ private val retainedPrivateVals = mutable.Set [Symbol ]()
45
+ private val seenPrivateVals = mutable.Set [Symbol ]()
47
46
48
47
private def markUsedPrivateSymbols (tree : RefTree )(implicit ctx : Context ): Unit = {
49
48
@@ -63,7 +62,6 @@ class Constructors extends MiniPhaseTransform with SymTransformer { thisTransfor
63
62
if (inConstructor && (sym.is(ParamAccessor ) || seenPrivateVals.contains(sym))) {
64
63
// used inside constructor, accessed on this,
65
64
// could use constructor argument instead, no need to retain field
66
- println(" hoha" )
67
65
}
68
66
else retain
69
67
case _ => retain
@@ -81,7 +79,6 @@ class Constructors extends MiniPhaseTransform with SymTransformer { thisTransfor
81
79
tree
82
80
}
83
81
84
-
85
82
override def transformValDef (tree : tpd.ValDef )(implicit ctx : Context , info : TransformerInfo ): tpd.Tree = {
86
83
if (mightBeDropped(tree.symbol))
87
84
(if (isWildcardStarArg(tree.rhs)) retainedPrivateVals else seenPrivateVals) += tree.symbol
@@ -254,8 +251,7 @@ class Constructors extends MiniPhaseTransform with SymTransformer { thisTransfor
254
251
info = clsInfo.derivedClassInfo(
255
252
decls = clsInfo.decls.filteredScope(! dropped.contains(_))))
256
253
257
- // TODO: this happens to work only because Constructors is the last phase in group
258
- }
254
+ // TODO: this happens to work only because Constructors is the last phase in groupp }
259
255
260
256
val (superCalls, followConstrStats) = constrStats.toList match {
261
257
case (sc : Apply ) :: rest if sc.symbol.isConstructor => (sc :: Nil , rest)
0 commit comments