We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ff27c8c commit cf2fed8Copy full SHA for cf2fed8
src/dotty/tools/dotc/transform/LambdaLift.scala
@@ -206,14 +206,11 @@ class LambdaLift extends MiniPhase with IdentityDenotTransformer { thisTransform
206
// Constructors and methods nested inside traits get the free variables
207
// of the enclosing trait or class.
208
// Conversely, local traits do not get free variables.
209
- if (!enclosure.is(Trait)) {
210
- val ss = symSet(free, enclosure)
211
- if (!ss(sym)) {
212
- ss += sym
+ if (!enclosure.is(Trait))
+ if (symSet(free, enclosure).add(sym)) {
213
changedFreeVars = true
214
ctx.log(i"$sym is free in $enclosure")
215
}
216
- }
217
218
if (intermediate.isRealClass) intermediate
219
else if (enclosure.isRealClass) enclosure
0 commit comments