Skip to content

Commit e0cd79a

Browse files
committed
Type inference: Filter away psuedo types in getTypeMentionRoot
1 parent e387ca4 commit e0cd79a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,10 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
368368
/** Gets the type at the empty path of `tm`. */
369369
bindingset[tm]
370370
pragma[inline_late]
371-
private Type getTypeMentionRoot(TypeMention tm) { result = tm.getTypeAt(TypePath::nil()) }
371+
private Type getTypeMentionRoot(TypeMention tm) {
372+
result = tm.getTypeAt(TypePath::nil()) and
373+
not result instanceof PseudoType
374+
}
372375

373376
/** Provides the input to `IsInstantiationOf`. */
374377
signature module IsInstantiationOfInputSig<HasTypeTreeSig App, HasTypeTreeSig Constraint> {
@@ -658,7 +661,8 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
658661
) {
659662
exists(Type type |
660663
typeConstraint(type, constraint) and typeCondition(type, abs, condition)
661-
)
664+
) and
665+
conditionSatisfiesConstraint(_, _, constraint, true)
662666
}
663667
}
664668

0 commit comments

Comments
 (0)