You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We don't even understand why the tmp.get call was allowed in the first place? Generic signatures should not have unified across union type boundaries... 😕
@RyanCavanaugh there is some additional code in #31023 that makes the call not-an-error, as the type parameters and argument lists in use are identical, so unifying them isn't so bad.
TypeScript Version: 3.4.0-dev.201xxxxx
Search Terms: union, index type
Code
Expected behavior:
Code compiles with
tmp.get('t')
having type"A" | "B"
.This works for:
Actual behavior:
Compilation fails with error:
Type of
tmp.get('t')
is only"A"
.Problem is not contained to string literals, but also other types. Enountered this bug using immutable-js Record.get().
Playground Link: playground
Related Issues: None found
The text was updated successfully, but these errors were encountered: