fix: when capturing, must check if already in captures
This commit is contained in:
parent
db45eb529d
commit
db241919f2
@ -19,7 +19,7 @@ public final class FunctionScope {
|
|||||||
public final boolean passthrough;
|
public final boolean passthrough;
|
||||||
|
|
||||||
private Variable addCaptured(Variable var, boolean captured) {
|
private Variable addCaptured(Variable var, boolean captured) {
|
||||||
if (captured && !this.capturables.has(var)) this.capturables.add(var);
|
if (captured && !this.capturables.has(var) && !this.captures.has(var)) this.capturables.add(var);
|
||||||
return var;
|
return var;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user