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
The contextual type for array element is sourcing the information from the string indexer of the Record type. This makes the contextual type of this function to be ((arg: string) => void) | ((arg: number) => void). The contravariant position of arg makes its type reduce to never (since it's string & number) and prevents the expected contextual type to be provided.
π Expected behavior
I'd expect this contextual type to only be sourced from the Array member
The text was updated successfully, but these errors were encountered:
Bug Report
π Search Terms
array tuple contextual type inference union implicit any
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
The contextual type for array element is sourcing the information from the string indexer of the
Record
type. This makes the contextual type of this function to be((arg: string) => void) | ((arg: number) => void)
. The contravariant position ofarg
makes its type reduce tonever
(since it'sstring & number
) and prevents the expected contextual type to be provided.π Expected behavior
I'd expect this contextual type to only be sourced from the
Array
memberThe text was updated successfully, but these errors were encountered: