File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
shared/typeflow/codeql/typeflow/internal Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -301,7 +301,7 @@ module TypeFlow<LocationSig Location, TypeFlowInput<Location> I> {
301
301
not irrelevantBound ( n , t )
302
302
}
303
303
304
- /**
304
+ /**
305
305
* Holds if the runtime type of `n` is bounded by `t` and if this bound is
306
306
* likely to be better than the static type of `n`. The flag `exact` indicates
307
307
* whether `t` is an exact bound or merely an upper bound.
@@ -389,14 +389,24 @@ module TypeFlow<LocationSig Location, TypeFlowInput<Location> I> {
389
389
)
390
390
}
391
391
392
+ /** Holds if this type is the same as its source declaration. */
393
+ private predicate isSourceDeclaration ( Type t ) { getSourceDeclaration ( t ) = t }
394
+
395
+ final private class FinalType = Type ;
396
+
397
+ /** A type that is the same as its source declaration. */
398
+ private class SrcType extends FinalType {
399
+ SrcType ( ) { isSourceDeclaration ( this ) }
400
+ }
401
+
392
402
/**
393
403
* Holds if there is a common (reflexive, transitive) subtype of the erased
394
404
* types `t1` and `t2`.
395
405
*/
406
+ pragma [ nomagic]
396
407
private predicate erasedHaveIntersection ( Type t1 , Type t2 ) {
397
- exists ( Type commonSub | commonSub = getSourceDeclaration ( commonSub ) |
398
- getASourceSupertype * ( commonSub ) = t1 and
399
- getASourceSupertype * ( commonSub ) = t2
408
+ exists ( SrcType commonSub |
409
+ getASourceSupertype * ( commonSub ) = t1 and getASourceSupertype * ( commonSub ) = t2
400
410
) and
401
411
t1 = getErasure ( _) and
402
412
t2 = getErasure ( _)
You can’t perform that action at this time.
0 commit comments