Closed amitdahan closed 2 months ago
Related #41, and specifically - this bug was introduced in #53.
Previously (when new Map() returned a Map<any, any>) - this would have worked:
new Map()
Map<any, any>
function expectsBooleanMap(map: Map<string, boolean>) {} expectsBooleanMap(new Map());
But with 0.6.0 it no longer works!
0.6.0
error TS2345: Argument of type 'Map<unknown, unknown>' is not assignable to parameter of type 'Map<string, boolean>'.
This also reproduces with usages such as:
const map: Map<string, boolean> = new Map(); const map = new Map() satisfies Map<string, boolean>;
Can confirm, after upgrade most new Map()s return a type error now, before they were type inferred properly.
(needed to revert to previous version)
Related #41, and specifically - this bug was introduced in #53.
Previously (when
new Map()
returned aMap<any, any>
) - this would have worked:But with
0.6.0
it no longer works!This also reproduces with usages such as: