Skip to content

Instantly share code, notes, and snippets.

@lucaswerkmeister
Created January 16, 2014 22:37
Show Gist options
  • Save lucaswerkmeister/8464874 to your computer and use it in GitHub Desktop.
Save lucaswerkmeister/8464874 to your computer and use it in GitHub Desktop.
Fix ceylon/ceylon-compiler#986 for 'if' comprehension clauses
diff --git a/src/com/redhat/ceylon/compiler/java/codegen/ExpressionTransformer.java b/src/com/redhat/ceylon/compiler/java/codegen/ExpressionTransformer.java
index c95c00a..f4d815a 100755
--- a/src/com/redhat/ceylon/compiler/java/codegen/ExpressionTransformer.java
+++ b/src/com/redhat/ceylon/compiler/java/codegen/ExpressionTransformer.java
@@ -4597,6 +4597,8 @@ public class ExpressionTransformer extends AbstractTransformer {
if (transformedCond.hasResultDecl()) {
fields.add(make().VarDef(make().Modifiers(Flags.PRIVATE),
resultVarName.asName(), transformedCond.makeTypeExpr(), null));
+ valueCaptures.add(make().VarDef(make().Modifiers(Flags.FINAL),
+ resultVarName.asName(), transformedCond.makeTypeExpr(), resultVarName.makeIdentWithThis()));
stmts = stmts.prepend(make().Exec(make().Assign(resultVarName.makeIdent(), transformedCond.makeResultExpr())));
}
stmts = List.<JCStatement>of(make().If(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment