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
You're not showing us the original declaration of origin.
If the third example allows promotion to work, most likely the origin variable is a local variable declared as something like Provider<T, dynamic>, some type where FactoryProvider<T, dynamic> is a subtype, but FactoryProvider<dynamic, dynamic> (or the equivalent FactoryProvider) is not, because the dynamic type argument is not a subtype of T.
Dart promotion requires the new type to be a subtype of the current type, otherwise it wouldn't be promotion.
Now, it would be nice if we could infer type arguments for is FactoryProvider which allows promotion, but we currently don't.
Same without
<dynamic,dynamic>
But in that case it starts working
The text was updated successfully, but these errors were encountered: