* Lazily compute signature type predicates * Use an instance of IdentifierTypePredicate to represent an unresolved type predicate * Simplify `getMaybeTypePredicate` * Invert representation of `resolvedTypePredicate` * Remove `__unresolvedTypePredicate` type and remember to use `noTypePredicate` instead of `undefined` when in all `createSignature` calls * Fix style of getTypePredicateOfSignature * Use in createGetSymbolWalker * Fix bugs for unions of type predicates * Code review * Make noTypePredicate purely an implementation detail of getTypePredictateOfSignature * Add test * Add test for #19642 * Add test with reversed order
16 lines
229 B
TypeScript
16 lines
229 B
TypeScript
interface A {
|
|
pred(x: {}, y: {}): x is boolean;
|
|
}
|
|
interface B {
|
|
pred(x: {}, y: {}): y is string;
|
|
}
|
|
|
|
type Or = A | B;
|
|
|
|
function f(o: Or, x: {}, y: {}) {
|
|
if (o.pred(x, y)) {
|
|
x;
|
|
y;
|
|
}
|
|
}
|