as
expression and array of union types
#28251
Labels
Question
An issue which isn't directly actionable in code
I'm not 100% sure this is a bug, but the behavior is not clear to me.
As a part of the state object I have an array that I want to be inferred as an array of the union type. I know this can be done by providing a type for the whole state (
const state: State = ...
), but I would like to rely on type inference since there are many other state properties of primitive types.Playground link.
The text was updated successfully, but these errors were encountered: