1425 * Two types or wildcards are considered disjoint if it can be |
1425 * Two types or wildcards are considered disjoint if it can be |
1426 * proven that no type can be contained in both. It is |
1426 * proven that no type can be contained in both. It is |
1427 * conservative in that it is allowed to say that two types are |
1427 * conservative in that it is allowed to say that two types are |
1428 * not disjoint, even though they actually are. |
1428 * not disjoint, even though they actually are. |
1429 * |
1429 * |
1430 * The type C<X> is castable to C<Y> exactly if X and Y are not |
1430 * The type {@code C<X>} is castable to {@code C<Y>} exactly if |
1431 * disjoint. |
1431 * {@code X} and {@code Y} are not disjoint. |
1432 */ |
1432 */ |
1433 public boolean disjointType(Type t, Type s) { |
1433 public boolean disjointType(Type t, Type s) { |
1434 return disjointType.visit(t, s); |
1434 return disjointType.visit(t, s); |
1435 } |
1435 } |
1436 // where |
1436 // where |
1521 /** |
1521 /** |
1522 * This relation answers the question: is impossible that |
1522 * This relation answers the question: is impossible that |
1523 * something of type `t' can be a subtype of `s'? This is |
1523 * something of type `t' can be a subtype of `s'? This is |
1524 * different from the question "is `t' not a subtype of `s'?" |
1524 * different from the question "is `t' not a subtype of `s'?" |
1525 * when type variables are involved: Integer is not a subtype of T |
1525 * when type variables are involved: Integer is not a subtype of T |
1526 * where <T extends Number> but it is not true that Integer cannot |
1526 * where {@code <T extends Number>} but it is not true that Integer cannot |
1527 * possibly be a subtype of T. |
1527 * possibly be a subtype of T. |
1528 */ |
1528 */ |
1529 public boolean notSoftSubtype(Type t, Type s) { |
1529 public boolean notSoftSubtype(Type t, Type s) { |
1530 if (t == s) return false; |
1530 if (t == s) return false; |
1531 if (t.tag == TYPEVAR) { |
1531 if (t.tag == TYPEVAR) { |