Skip to content

Commit 3230804

Browse files
Check if the target types are equal instead of the types themselves.
1 parent 228f423 commit 3230804

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6894,7 +6894,7 @@ namespace ts {
68946894
// subtype of T but not structurally identical to T. This specifically means that two distinct but
68956895
// structurally identical types (such as two classes) are not considered instances of each other.
68966896
function isTypeInstanceOf(source: Type, target: Type): boolean {
6897-
return source === target || isTypeSubtypeOf(source, target) && !isTypeIdenticalTo(source, target);
6897+
return getTargetType(source) === getTargetType(target) || isTypeSubtypeOf(source, target) && !isTypeIdenticalTo(source, target);
68986898
}
68996899

69006900
/**

0 commit comments

Comments
 (0)