@@ -1194,8 +1194,8 @@ private Type erase(Type t) {
11941194}
11951195
11961196/**
1197- * Is there a common (reflexive, transitive) subtype of the erasures of
1198- * types `t1` and `t2`?
1197+ * Holds if there is a common (reflexive, transitive) subtype of the erasures of
1198+ * types `t1` and `t2`.
11991199 *
12001200 * If there is no such common subtype, then the two types are disjoint.
12011201 * However, the converse is not true; for example, the parameterized types
@@ -1212,6 +1212,25 @@ predicate haveIntersection(RefType t1, RefType t2) {
12121212 )
12131213}
12141214
1215+ /**
1216+ * Holds if there is no common (reflexive, transitive) subtype of the erasures
1217+ * of types `t1` and `t2`.
1218+ *
1219+ * If there is no such common subtype, then the two types are disjoint.
1220+ * However, the converse is not true; for example, the parameterized types
1221+ * `List<Integer>` and `Collection<String>` are disjoint,
1222+ * but their erasures (`List` and `Collection`, respectively)
1223+ * do have common subtypes (such as `List` itself).
1224+ *
1225+ * For the definition of the notion of *erasure* see JLS v8, section 4.6 (Type Erasure).
1226+ */
1227+ bindingset [ t1, t2]
1228+ predicate notHaveIntersection ( RefType t1 , RefType t2 ) {
1229+ exists ( RefType e1 , RefType e2 | e1 = erase ( t1 ) and e2 = erase ( t2 ) |
1230+ not erasedHaveIntersection ( e1 , e2 )
1231+ )
1232+ }
1233+
12151234/**
12161235 * Holds if there is a common (reflexive, transitive) subtype of the erased
12171236 * types `t1` and `t2`.
0 commit comments