mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Address CR feedback
This commit is contained in:
@@ -7603,10 +7603,12 @@ namespace ts {
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Find each target constituent type that has an identically matching source
|
||||
// constituent type, and for each such target constituent type infer from the type to
|
||||
// itself. When inferring from a type to itself we effectively find all type parameter
|
||||
// occurrences within that type and infer themselves as their type arguments.
|
||||
// Find each source constituent type that has an identically matching target constituent
|
||||
// type, and for each such type infer from the type to itself. When inferring from a
|
||||
// type to itself we effectively find all type parameter occurrences within that type
|
||||
// and infer themselves as their type arguments. We have special handling for numeric
|
||||
// and string literals because the number and string types are not represented as unions
|
||||
// of all their possible values.
|
||||
let matchingTypes: Type[];
|
||||
for (const t of (<UnionOrIntersectionType>source).types) {
|
||||
if (typeIdenticalToSomeType(t, (<UnionOrIntersectionType>target).types)) {
|
||||
@@ -7616,8 +7618,7 @@ namespace ts {
|
||||
else if (t.flags & (TypeFlags.NumberLiteral | TypeFlags.StringLiteral)) {
|
||||
const b = getBaseTypeOfLiteralType(t);
|
||||
if (typeIdenticalToSomeType(b, (<UnionOrIntersectionType>target).types)) {
|
||||
(matchingTypes || (matchingTypes = [])).push(t);
|
||||
matchingTypes.push(b);
|
||||
(matchingTypes || (matchingTypes = [])).push(t, b);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user