diff --git a/src/main/java/de/maishai/typedast/typedclass/TypedBinary.java b/src/main/java/de/maishai/typedast/typedclass/TypedBinary.java index 0546da8..880225e 100644 --- a/src/main/java/de/maishai/typedast/typedclass/TypedBinary.java +++ b/src/main/java/de/maishai/typedast/typedclass/TypedBinary.java @@ -203,7 +203,6 @@ public class TypedBinary implements TypedExpression { ctx.getMv().visitInsn(Opcodes.IMUL); } } - //TODO: implement other operators ctx.popStack(); } } diff --git a/src/main/java/de/maishai/typedast/typedclass/TypedBlock.java b/src/main/java/de/maishai/typedast/typedclass/TypedBlock.java index f234391..0d08a71 100644 --- a/src/main/java/de/maishai/typedast/typedclass/TypedBlock.java +++ b/src/main/java/de/maishai/typedast/typedclass/TypedBlock.java @@ -119,7 +119,7 @@ public class TypedBlock implements TypedNode { public void codeGen(MethodContext ctx) { for (TypedLocalVariable var : vars) { - //var.codeGen(ctx); + ctx.registerVariable(var.getName(), var.getType()); } for (TypedStatement stmt : stmts) { stmt.codeGen(ctx); diff --git a/src/main/resources/JavaTestfiles/ClassCanBeTyped.java b/src/main/resources/JavaTestfiles/ClassCanBeTyped.java index 85a8236..4cae684 100644 --- a/src/main/resources/JavaTestfiles/ClassCanBeTyped.java +++ b/src/main/resources/JavaTestfiles/ClassCanBeTyped.java @@ -1,11 +1,16 @@ public class ClassCanBeTyped { - public ClassCanBeTyped c; + public ClassCanBeTyped p; public int x; public boolean y; - public boolean test(boolean b, boolean c) { - return b || c; + public int test(boolean b, boolean c) { + int y; + y = 0; + if (b && c) { + y = 12; + } + return y; } }