Can someone confirm, maybe @Baizey that analyse is implemented for ternary ops?
public JExpression analyze(Context context) {
condition = condition.analyze(context);
ifTrue = ifTrue.analyze(context);
ifFalse = ifFalse.analyze(context);
if (condition.type() != Type.BOOLEAN)
JAST.compilationUnit.reportSemanticError(line(), "Ternary condition must evaluate to bool, evaluated to " + condition.type());
if (ifTrue.type() != ifFalse.type())
JAST.compilationUnit.reportSemanticError(line(), "Ternary cases must evaluate to same type, evaluated to " + ifTrue.type() + " and " + ifFalse.type());
type = ifTrue.type();
return this;
}
Can someone confirm, maybe @Baizey that analyse is implemented for ternary ops?
??