Type inference with conditional for array fails for literal #39162
Labels
Needs Investigation
This issue needs a team member to investigate its status.
Milestone
TypeScript Version: 3.9.2
Search Terms: typescript infer array type conditional literal
Code
Expected behavior:
No error is thrown.
Actual behavior:
The commented function call throws the following error:
Playground Link: https://www.typescriptlang.org/play/#code/GYVwdgxgLglg9mABKSAeAKgPgBRwA5QBciA3gFCKIBuAhgDYgCmx6A3BYjQE5c0CeANXpMWiRgA8ojMABMAzpzB8A2gF1EAfkTpELNewC+ASlIGyZFBGzlKtBs0TKAjABpEAJjcBmVS47deQWEHZzdPRB8-Y3MIBDkoRDgAIwArRABeUg47EUdXD29ffx5+IXtiUIKIooN2C3ArZJSjdiA
Related Issues:
The text was updated successfully, but these errors were encountered: