mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-24 04:30:53 -06:00
fix(WeakMapConstructor): readonly iterable items (#43905)
like `MapConstructor`, `WeakMapConstructor` should support receiving `Iterable<readonly [K, V]>` instead of `Iterable<[K, V]>`; otherwise tuples creates with `as const`, etc. cannot be safely passed in without casts, etc.
This commit is contained in:
parent
4a59b63f35
commit
7901f351eb
2
src/lib/es2015.iterable.d.ts
vendored
2
src/lib/es2015.iterable.d.ts
vendored
@ -143,7 +143,7 @@ interface MapConstructor {
|
||||
interface WeakMap<K extends object, V> { }
|
||||
|
||||
interface WeakMapConstructor {
|
||||
new <K extends object, V>(iterable: Iterable<[K, V]>): WeakMap<K, V>;
|
||||
new <K extends object, V>(iterable: Iterable<readonly [K, V]>): WeakMap<K, V>;
|
||||
}
|
||||
|
||||
interface Set<T> {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user