diff --git a/java/ql/lib/semmle/code/java/Type.qll b/java/ql/lib/semmle/code/java/Type.qll index aa1cc5fdc7f..dd646e74285 100644 --- a/java/ql/lib/semmle/code/java/Type.qll +++ b/java/ql/lib/semmle/code/java/Type.qll @@ -1261,14 +1261,21 @@ private Type erase(Type t) { * * For the definition of the notion of *erasure* see JLS v8, section 4.6 (Type Erasure). */ +bindingset[t1, t2] overlay[caller?] -pragma[inline] +pragma[inline_late] predicate haveIntersection(RefType t1, RefType t2) { exists(RefType e1, RefType e2 | e1 = erase(t1) and e2 = erase(t2) | - erasedHaveIntersection(e1, e2) + erasedHaveIntersectionFilter(e1, e2) ) } +bindingset[t1, t2] +pragma[inline_late] +private predicate erasedHaveIntersectionFilter(RefType t1, RefType t2) { + erasedHaveIntersection(t1, t2) +} + /** * Holds if there is no common (reflexive, transitive) subtype of the erasures * of types `t1` and `t2`.