TypeScript Version: 3.1.0-dev.20180906
Search Terms:
Code
interface Item {
x: number;
y: 'a' | 'b'
}
var list:Item[] = [].map(it => ({x: 1, y: 'a'}))
Expected behavior:
No error
Actual behavior:
Type 'string' is not assignable to type '"a" | "b"'.
Root cause is #241
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.
This will be fixed by #40311, see the comment I just left on #33158.
It won't be fixed by #40311 unfortunately (see the "Future Work" section in the PR writeup)
Well crud. This is all my fault, I had a bunch of related tabs open and posted this comment in a few of them where I thought the issue being reported was the same -- this wasn't one of them. Sorry!
Don't sweat it, I had the same enthusiasm at first. 馃槄