return new ResolveResult(childResult.getType());
}
@Override
public ResolveResult visitConditionalExpression(final ConditionalExpression node, final Void data) {
final ResolveResult conditionResult = node.getCondition().acceptVisitor(this, data);
if (conditionResult != null &&
conditionResult.isCompileTimeConstant()) {
if (Boolean.TRUE.equals(conditionResult.getConstantValue())) {
return node.getTrueExpression().acceptVisitor(this, data);
}
if (Boolean.FALSE.equals(conditionResult.getConstantValue())) {
return node.getFalseExpression().acceptVisitor(this, data);
}
}
final TypeReference resultType = doBinaryPromotionStrict(
node.getTrueExpression().acceptVisitor(this, data),
node.getFalseExpression().acceptVisitor(this, data)
);
if (resultType != null) {
return new ResolveResult(resultType);
}
return null;
}