Open
Description
TypeScript Version: 2.1.1
Code
const x = new Map<string, string>();
x.set("key", "value");
if (x.has("key")) {
const y : string = x.get("key"); // error: y is string | undefined, not string
}
Expected behavior:
y is narrowed down to string
Actual behavior:
y is still string | undefined even after checking if the map has that key