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
Type Inference does not work for generics with default types #19205
Currently generic type inference happens only when no generic type arguments are provided. specifying at least one disables all generic inference. #10571 tracks allowing partial generic inference for required parameters. I would say we will do the default automatic inference in the same change.
in the above example, you have used FormattedDataProvider<T> in the definition of ConfiguredDataProvider<T> without a second argument. this is identical to FormattedDataProvider<T , {}>.
if you wanted to propagate the optionality of the second argument you would write it as:
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
Activity
mhegazy commentedon Oct 16, 2017
Currently generic type inference happens only when no generic type arguments are provided. specifying at least one disables all generic inference.
#10571 tracks allowing partial generic inference for required parameters. I would say we will do the default automatic inference in the same change.
mhegazy commentedon Oct 16, 2017
closing in favor of #10571
jpkraemer commentedon Oct 17, 2017
Thanks for the clarification, indeed the following example works:
This one however, does not. So even when not specifying any types, the defaults might disable inference, too, in some instances.
mhegazy commentedon Oct 17, 2017
in the above example, you have used
FormattedDataProvider<T>in the definition ofConfiguredDataProvider<T>without a second argument. this is identical toFormattedDataProvider<T , {}>.if you wanted to propagate the optionality of the second argument you would write it as:
mhegazy commentedon Oct 31, 2017
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.