Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify code generation for quotable lambdas not to require duplicate capture argument lists #249

Closed
Original file line number Diff line number Diff line change
@@ -529,7 +529,7 @@ class BodyScanner extends FilterScanner {
ListBuffer<Type> capturedTypes = new ListBuffer<>();
if (lambdaCaptureScanner.capturesThis) {
capturedTypes.add(currentClassSym.type);
blockArgOffset++;
blockParamOffset++;
}
for (Symbol s : capturedSymbols) {
capturedTypes.add(s.type);
@@ -544,7 +544,7 @@ class BodyScanner extends FilterScanner {

// add captured variables mappings
for (int i = 0 ; i < capturedSymbols.size() ; i++) {
var capturedArg = top.block.parameters().get(blockArgOffset + i);
var capturedArg = top.block.parameters().get(blockParamOffset + i);
Symbol capturedSymbol = capturedSymbols.get(i);
top.localToOp.put(capturedSymbol,
append(CoreOp.var(capturedSymbol.name.toString(), capturedArg)));