Skip to content

Commit b718c4d

Browse files
authored
Merge pull request #2123 from septs/ro-map
2 parents 59a61eb + 71f0d60 commit b718c4d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

type-definitions/immutable.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ declare namespace Immutable {
617617
* but since Immutable Map keys can be of any type the argument to `get()` is
618618
* not altered.
619619
*/
620-
function Map<K, V>(collection?: Iterable<[K, V]>): Map<K, V>;
620+
function Map<K, V>(collection?: Iterable<readonly [K, V]>): Map<K, V>;
621621
function Map<R extends { [key in PropertyKey]: unknown }>(obj: R): MapOf<R>;
622622
function Map<V>(obj: { [key: string]: V }): Map<string, V>;
623623
function Map<K extends string | symbol, V>(obj: { [P in K]?: V }): Map<K, V>;

type-definitions/ts-tests/map.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ test('#constructor', () => {
1010

1111
expect(Map([['a', 'a']])).type.toBe<Map<string, string>>();
1212

13+
expect(Map([] as ReadonlyArray<readonly [number, string]>)).type.toBe<
14+
Map<number, string>
15+
>();
16+
1317
expect(Map(List<[number, string]>([[1, 'a']]))).type.toBe<
1418
Map<number, string>
1519
>();

0 commit comments

Comments
 (0)