We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b29060 commit 2541a5dCopy full SHA for 2541a5d
src/compiler/checker.ts
@@ -15958,9 +15958,14 @@ namespace ts {
15958
}
15959
15960
15961
+ function isTypeReferenceToSameTarget(source: Type, target: Type) {
15962
+ return !!(getObjectFlags(source) & ObjectFlags.Reference && getObjectFlags(target) & ObjectFlags.Reference &&
15963
+ (<TypeReference>source).target === (<TypeReference>target).target);
15964
+ }
15965
+
15966
function typeIdenticalToSomeType(type: Type, types: Type[]): boolean {
15967
for (const t of types) {
- if (isTypeIdenticalTo(t, type)) {
15968
+ if (t === type || !isTypeReferenceToSameTarget(t, type) && isTypeIdenticalTo(t, type)) {
15969
return true;
15970
15971
0 commit comments