diff --git a/type-definitions/immutable.d.ts b/type-definitions/immutable.d.ts index 43119ccab6..5882a7b0ef 100644 --- a/type-definitions/immutable.d.ts +++ b/type-definitions/immutable.d.ts @@ -617,7 +617,7 @@ declare namespace Immutable { * but since Immutable Map keys can be of any type the argument to `get()` is * not altered. */ - function Map(collection?: Iterable<[K, V]>): Map; + function Map(collection?: Iterable): Map; function Map(obj: R): MapOf; function Map(obj: { [key: string]: V }): Map; function Map(obj: { [P in K]?: V }): Map; diff --git a/type-definitions/ts-tests/map.ts b/type-definitions/ts-tests/map.ts index 59f39eb36c..cd8fa7b237 100644 --- a/type-definitions/ts-tests/map.ts +++ b/type-definitions/ts-tests/map.ts @@ -10,6 +10,10 @@ test('#constructor', () => { expect(Map([['a', 'a']])).type.toBe>(); + expect(Map([] as ReadonlyArray)).type.toBe< + Map + >(); + expect(Map(List<[number, string]>([[1, 'a']]))).type.toBe< Map >();