If the two reference types of a trinary expression are not in a subtype relationship, MultiJava complains by returning "File "CondTest.java", line 4, character 34 error: Incompatible types in trinary expression [JLS 15.24]"
In the code, it is enforced that either one has to be the supertype and the other the subtype
Example:
class CondTest {
void m() {
Object o = true ? "" : new Integer(5);
}
}
String "" and Integer 5 are in no subtype relationship. Correct was to take the greatest common supertype, i.e. Object.