mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 03:23:08 -06:00
Properly account for 'this' parameter in type predicate checks
This commit is contained in:
parent
a1a2006074
commit
e3b4c90970
@ -11565,7 +11565,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
if (isIdentifierTypePredicate(predicate)) {
|
||||
const predicateArgument = callExpression.arguments[predicate.parameterIndex];
|
||||
const predicateArgument = callExpression.arguments[predicate.parameterIndex - (signature.thisParameter ? 1 : 0)];
|
||||
if (predicateArgument) {
|
||||
if (isMatchingReference(reference, predicateArgument)) {
|
||||
return getNarrowedType(type, predicate.type, assumeTrue, isTypeSubtypeOf);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user