Skip to content

Commit 75e007b

Browse files
committed
Mark dropped private vars without rhs as indeed dropped.
Otherwise, their `ValDef`s are removed but they are not removed from their owner class' scope.
1 parent 72ae7d6 commit 75e007b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/transform/Constructors.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ class Constructors extends MiniPhase with IdentityDenotTransformer { thisPhase =
204204
initFlags = sym.flags &~ Private,
205205
owner = constr.symbol).installAfter(thisPhase)
206206
constrStats += intoConstr(stat, sym)
207-
}
207+
} else
208+
dropped += sym
208209
case stat @ DefDef(name, _, _, tpt, _)
209210
if stat.symbol.isGetter && stat.symbol.owner.is(Trait) && !stat.symbol.is(Lazy) =>
210211
val sym = stat.symbol

0 commit comments

Comments
 (0)