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
{{ message }}
Repository navigation
Unable to infer types correctly from generic on function #26418
Generic inference is a single-pass process; inferring a type for options here would require a process of an arbitrary number of passes.
#14829 wouldn't fix this on its own, but it'd be a prerequisite for deferring applying a type to the options parameter to allow a contextual type from T to be present.
Activity
RyanCavanaugh commentedon Aug 13, 2018
Generic inference is a single-pass process; inferring a type for
optionshere would require a process of an arbitrary number of passes.#14829 wouldn't fix this on its own, but it'd be a prerequisite for deferring applying a type to the
optionsparameter to allow a contextual type fromTto be present.agubler commentedon Aug 13, 2018
Thanks for the response Ryan Cavanaugh (@RyanCavanaugh), glad that I’m not just doing something silly!
agubler commentedon Feb 20, 2019
Ryan Cavanaugh (@RyanCavanaugh) Interestingly using
tsxwith the following a simple globalJSXnamespacethe properties and any function arguments are all inferred correctly:
I guess this is because something "special" is happening?