throw new WeaselCompilerException(token.line, "Can't write any value to Condition");
}
WeaselInstructionList instructions;
WeaselCompilerReturn wcr = condition.compile(compiler, compilerHelper, null, new WeaselGenericClass(compiler.baseTypes.booleanClass), null, false);
instructions = wcr.getInstructions(compiler, compiler.baseTypes.booleanClass);
WeaselInstructionJump j1;
WeaselInstructionJump j2;
instructions.add(token.line, j1 = new WeaselInstructionIf());
wcr = tree1.compile(compiler, compilerHelper, null, expect, elementParent, isVariable);
WeaselGenericClass wc = wcr.getReturnType();
instructions.addAll(wcr.getInstructions());
wcr = tree2.compile(compiler, compilerHelper, null, expect, elementParent, isVariable);
if(wc.getBaseClass()==compiler.baseTypes.voidClass || wcr.getReturnType().getBaseClass()==compiler.baseTypes.voidClass){
throw new WeaselCompilerException(token.line, "Can't return void");
}
WeaselGenericClass wc2 = wcr.getReturnType();
wc = WeaselTree.autoCast(compiler, wc, wc2, token.line, instructions, false);
instructions.add(token.line, j2 = new WeaselInstructionJump());
j1.setTarget(j2);
instructions.addAll(wcr.getInstructions());
wc2 = WeaselTree.autoCast(compiler, wc2, wc, token.line, instructions, true);
j2.setTarget(instructions.getLast());
return new WeaselCompilerReturnInstructionList(instructions, WeaselGenericClass.getSmallestSame(wc, wc2));
}