mattunlv / ProcessJ-main-branch-old

ProcessJ Compiler Project
2 stars 4 forks source link

Alt stats that aren't enclosed in a block chokes the codegen #6

Closed cabelshrestha closed 7 years ago

cabelshrestha commented 7 years ago
alt {
  any = left.read() : {
    left.read();
  } //works

  any = right.read() : 
    right.read(); // chokes
}

Codegen exception:

Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to [Ljava.lang.String;
    at CodeGeneratorJava.CodeGeneratorJava.visitAltStat(CodeGeneratorJava.java:247)
    at AST.AltStat.visit(AltStat.java:19)
    at CodeGeneratorJava.CodeGeneratorJava.visitSequence(CodeGeneratorJava.java:1890)
    at AST.Sequence.visit(Sequence.java:58)
    at CodeGeneratorJava.CodeGeneratorJava.visitBlock(CodeGeneratorJava.java:1015)

matt