Skip to content

Commit c2ae6ee

Browse files
committed
Type inference: Filter away psuedo types in more places
1 parent e387ca4 commit c2ae6ee

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎shared/typeinference/codeql/typeinference/internal/TypeInference.qll‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,21 +644,24 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
644644
pragma[nomagic]
645645
private predicate typeCondition(Type type, TypeAbstraction abs, TypeMention condition) {
646646
conditionSatisfiesConstraint(abs, condition, _, _) and
647-
type = getTypeMentionRoot(condition)
647+
type = getTypeMentionRoot(condition) and
648+
not type instanceof PseudoType
648649
}
649650

650651
pragma[nomagic]
651652
private predicate typeConstraint(Type type, TypeMention constraint) {
652653
conditionSatisfiesConstraint(_, _, constraint, _) and
653-
type = getTypeMentionRoot(constraint)
654+
type = getTypeMentionRoot(constraint) and
655+
not type instanceof PseudoType
654656
}
655657

656658
predicate potentialInstantiationOf(
657659
TypeMention constraint, TypeAbstraction abs, TypeMention condition
658660
) {
659661
exists(Type type |
660662
typeConstraint(type, constraint) and typeCondition(type, abs, condition)
661-
)
663+
) and
664+
conditionSatisfiesConstraint(_, _, constraint, true)
662665
}
663666
}
664667

0 commit comments

Comments
 (0)