mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-26 10:43:51 -05:00
Add known keys of the mapped type constraint to its members (#50081)
* Add known keys of the mapped type constraint to its members * Avoid second pass of adding known members by instead passing `noReductions` to `mapType`
This commit is contained in:
committed by
GitHub
parent
48aebcdcdb
commit
39ccac654c
@@ -12021,7 +12021,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
return type;
|
||||
}
|
||||
if (type.flags & TypeFlags.Union) {
|
||||
return mapType(type as UnionType, getLowerBoundOfKeyType);
|
||||
return mapType(type as UnionType, getLowerBoundOfKeyType, /*noReductions*/ true);
|
||||
}
|
||||
if (type.flags & TypeFlags.Intersection) {
|
||||
// Similarly to getTypeFromIntersectionTypeNode, we preserve the special string & {}, number & {},
|
||||
|
||||
Reference in New Issue
Block a user