#49625 breaks node's type tests on DT.
Note that this causes node's util to return a union where it didn't before:
functionisMap<T>(object: T|{}): object is TextendsReadonlyMap<any,any> ? (unknownextendsT ? never : ReadonlyMap<any,any>) : Map<unknown,unknown>;declareconstromor: ReadonlyMap<any,any>|Record<any,any>if(types.isMap(romor)){romor;// $ExpectType ReadonlyMap<any, any>}But it's ReadonlyMap<any, any> | Map<unknown, unknown> now.
I think this is correct, because the conditional type distributes and ReadonlyMap extends ReadonlyMap, while Record<any, any> doesn't. So the result is the union of the conditional's branches. However, this might turn out to be too big a breaking change for node, so I want to track it here.
Piotr Błażejewicz (Peter Blazejewicz) (@peterblazejewicz) also noticed discussion at DefinitelyTyped/DefinitelyTyped#61353 on this change.
#49625 breaks node's type tests on DT.
Note that this causes node's
utilto return a union where it didn't before:But it's
ReadonlyMap<any, any> | Map<unknown, unknown>now.I think this is correct, because the conditional type distributes and ReadonlyMap extends ReadonlyMap, while Record<any, any> doesn't. So the result is the union of the conditional's branches. However, this might turn out to be too big a breaking change for node, so I want to track it here.
Piotr Błażejewicz (Peter Blazejewicz) (@peterblazejewicz) also noticed discussion at DefinitelyTyped/DefinitelyTyped#61353 on this change.