Repository: TypeScript
Issue: Fails type check for type unions as keys to the Map constructor
Labels: Bug

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ

Please fill in the *entire* template below.
-->

**TypeScript Version:**  3.9.2

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**

**Expected behavior:**

The example code should not fail type checking.

In general a map with a type union as keys `Map<A | B, V>` should accept either type (`A` or `B`) as keys in the `Map()` constructor.

**Actual behavior:**

In general the map will fail type checking if both subtypes `A` *and* `B` appear as keys in the `Map()` constructor.

```ts
let a: A;
let b: B;

// ...

const map: Map<A | B, V> = new Map([
  [a, aValue],
  [b, bValue],
]);
```

The example code fails type checking with the error message: 

```
const ANSWER: typeof ANSWER
No overload matches this call.
  Overload 1 of 4, '(iterable: Iterable<readonly [string, number]>): Map<string, number>', gave the following error.
    Argument of type '([string, number] | [symbol, number])[]' is not assignable to parameter of type 'Iterable<readonly [string, number]>'.
      The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types.
        Type 'IteratorResult<[string, number] | [symbol, number], any>' is not assignable to type 'IteratorResult<readonly [string, number], any>'.
          Type 'IteratorYieldResult<[string, number] | [symbol, number]>' is not assignable to type 'IteratorResult<readonly [string, number], any>'.
            Type 'IteratorYieldResult<[string, number] | [symbol, number]>' is not assignable to type 'IteratorYieldResult<readonly [string, number]>'.
              Type '[string, number] | [symbol, number]' is not assignable to type 'readonly [string, number]'.
                Type '[symbol, number]' is not assignable to type 'readonly [string, number]'.
                  Types of property '0' are incompatible.
                    Type 'symbol' is not assignable to type 'string'.
  Overload 2 of 4, '(iterable: Iterable<readonly [string, number]>): Map<string, number>', gave the following error.
    Argument of type '([string, number] | [symbol, number])[]' is not assignable to parameter of type 'Iterable<readonly [string, number]>'.
  Overload 3 of 4, '(entries?: readonly (readonly [string, number])[] | null | undefined): Map<string, number>', gave the following error.
    Type 'symbol' is not assignable to type 'string'.
```

<!-- Did you find other bugs that looked similar? -->
**Related Issues:**

**Code**
```ts
const ANSWER = Symbol("The ultimate question");
const map: Map<string | symbol, number> = new Map([
    ["foo", 1],
    ["bar", 2],
    [ANSWER, 42],
]);

// This is OK
map.set(ANSWER, 4_000_000_000);
```



<details><summary><b>Output</b></summary>

```ts
"use strict";
const ANSWER = Symbol("The ultimate question");
const map = new Map([
    ["foo", 1],
    ["bar", 2],
    [ANSWER, 42],
]);
// This is OK
map.set(ANSWER, 4000000000);

```


</details>


<details><summary><b>Compiler Options</b></summary>

```json
{
  "compilerOptions": {
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "strictPropertyInitialization": true,
    "strictBindCallApply": true,
    "noImplicitThis": true,
    "noImplicitReturns": true,
    "useDefineForClassFields": false,
    "alwaysStrict": true,
    "allowUnreachableCode": false,
    "allowUnusedLabels": false,
    "downlevelIteration": false,
    "noEmitHelpers": false,
    "noLib": false,
    "noStrictGenericChecks": false,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "esModuleInterop": true,
    "preserveConstEnums": false,
    "removeComments": false,
    "skipLibCheck": false,
    "checkJs": false,
    "allowJs": false,
    "declaration": true,
    "experimentalDecorators": false,
    "emitDecoratorMetadata": false,
    "target": "ES2017",
    "module": "ESNext"
  }
}
```


</details>

**Playground Link:** [Provided](https://www.typescriptlang.org/play/index.html#code/MYewdgzgLgBAggOQMoHUCiAlGBeGSCeAtgEYgA2AFAEQAqAFgKYwCuZUAloQIZRMCOzBtHbgqASgDcAKFCRY3AA4AuGAFkuCgDzQATuzABzGAB8YEIqTIAaGGGYkGOgHw5bDAO5qNFANpSYATA+VABmICBUNgCMALpW-oHBxFw6kTAATHEJAT6IqJg2ACyZ8TGSUlIA9JUw9OwQMPUwAPIA0lKKAHQQDFAUeegYRQD6AAzjYxPjo5JAA)