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
I'm new to Dart, so this could be just a language quirk, but the examples in the readme don't provide give any type info to the arguments in the combiner function. When doing that, they're actually dynamic, inference doesn't work.
Couldn't infer type parameter 'R2'.
Tried to infer 'int' for 'R2' which doesn't work:
Parameter 'combiner' declared as '(R1, R2) → T'
but argument is '(String, String) → String'.
The type 'int' was inferred from:
Parameter 'selector2' declared as '(S) → R2'
but argument is '(ExampleState) → int'.
Consider passing explicit type argument(s) to the generic.
dart(strong_mode_could_not_infer)
Could this have something to do with my analysis_options.yaml file? Or is Dart's inference nowhere near the level in TypeScript?
The text was updated successfully, but these errors were encountered:
Hey @mikew I'm like you at the time, new to Dart. Two years later this issue has not been treated and also bothers me, but it does not look like it can be fixed.
See dart-lang/sdk#34408 where it seems like Dart team won't fix that soonly.
I'm new to Dart, so this could be just a language quirk, but the examples in the readme don't provide give any type info to the arguments in the combiner function. When doing that, they're actually
dynamic
, inference doesn't work.Given this:
Here is what the readme says to do:
But
firstName
andage
are dynamic, providing type info works but results in duplication:What's worse is when you give the wrong type info, Dart suddenly smartens up and says it can't happen:
yields:
Could this have something to do with my
analysis_options.yaml
file? Or is Dart's inference nowhere near the level in TypeScript?The text was updated successfully, but these errors were encountered: