Closed
Description
Hello, i found an interesting issue. When i am passing an object in Map it works fine:
import {Map} from 'immutable';
...
const myMap = Map({a: 1});
But when i am trying to pass an array like on screen below, compiler complains:
const myMap = Map([[ "key", "value" ]]);
I took a that variant from here: https://immutable-js.github.io/immutable-js/docs/#/Map/Map
Argument of type 'string[][]' is not assignable to parameter of type '{ [key: string]: {}; }'. Index signature is missing in type 'string[][]'
In my opinion, it works that way because we have an overloaded Map functions at definitions file, and typescript choosing second variant instead of first.
immutable-nonambient.d.ts: 761
export function Map<K, V>(collection: Iterable<[K, V]>): Map<K, V>;
export function Map<V>(obj: {[key: string]: V}): Map<string, V>;
ts version: 3.3.333333