mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-07 14:34:35 -06:00
Revert change to substitution type simplification
This commit is contained in:
parent
fb6ae38ddf
commit
4b5968eb6d
@ -10196,7 +10196,6 @@ namespace ts {
|
||||
function getSimplifiedType(type: Type, writing: boolean): Type {
|
||||
return type.flags & TypeFlags.IndexedAccess ? getSimplifiedIndexedAccessType(<IndexedAccessType>type, writing) :
|
||||
type.flags & TypeFlags.Conditional ? getSimplifiedConditionalType(<ConditionalType>type, writing) :
|
||||
type.flags & TypeFlags.Substitution ? writing ? (<SubstitutionType>type).typeVariable : (<SubstitutionType>type).substitute :
|
||||
type;
|
||||
}
|
||||
|
||||
@ -12432,6 +12431,12 @@ namespace ts {
|
||||
if (isFreshLiteralType(target)) {
|
||||
target = (<FreshableType>target).regularType;
|
||||
}
|
||||
if (source.flags & TypeFlags.Substitution) {
|
||||
source = (<SubstitutionType>source).substitute;
|
||||
}
|
||||
if (target.flags & TypeFlags.Substitution) {
|
||||
target = (<SubstitutionType>target).typeVariable;
|
||||
}
|
||||
if (source.flags & TypeFlags.Simplifiable) {
|
||||
source = getSimplifiedType(source, /*writing*/ false);
|
||||
}
|
||||
|
||||
@ -3967,7 +3967,7 @@ namespace ts {
|
||||
/* @internal */
|
||||
ObjectFlagsType = Nullable | Never | Object | Union | Intersection,
|
||||
/* @internal */
|
||||
Simplifiable = IndexedAccess | Conditional | Substitution,
|
||||
Simplifiable = IndexedAccess | Conditional,
|
||||
// 'Narrowable' types are types where narrowing actually narrows.
|
||||
// This *should* be every type other than null, undefined, void, and never
|
||||
Narrowable = Any | Unknown | StructuredOrInstantiable | StringLike | NumberLike | BigIntLike | BooleanLike | ESSymbol | UniqueESSymbol | NonPrimitive,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user