Always infer between distinct type references to same target
This commit is contained in:
parent
6b29060111
commit
2541a5d0ff
1 changed files with 6 additions and 1 deletions
|
@ -15958,9 +15958,14 @@ namespace ts {
|
|||
}
|
||||
}
|
||||
|
||||
function isTypeReferenceToSameTarget(source: Type, target: Type) {
|
||||
return !!(getObjectFlags(source) & ObjectFlags.Reference && getObjectFlags(target) & ObjectFlags.Reference &&
|
||||
(<TypeReference>source).target === (<TypeReference>target).target);
|
||||
}
|
||||
|
||||
function typeIdenticalToSomeType(type: Type, types: Type[]): boolean {
|
||||
for (const t of types) {
|
||||
if (isTypeIdenticalTo(t, type)) {
|
||||
if (t === type || !isTypeReferenceToSameTarget(t, type) && isTypeIdenticalTo(t, type)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue