-
Notifications
You must be signed in to change notification settings - Fork 27
Flag for error on reified dynamic #365
Comments
Would this even let us write:
? The reified type of |
I'm not sure that would be a problem, as it's just the type annotation. The issue would only come up when you're creating instances of generic types. |
We had some discussion offline, but following up with some additional thoughts. In general, yes, there is a problem with using List in the type of a function, if you're trying to avoid reified dynamic with the intention of allowing unconstrained (or less constrained) typedef List<int> F();
List foo() {};
var b = foo is F; The VM will say that
So for example: typedef void F(List<int);
void bar(List l) {};
var b = bar is F; Here, the VM and DDC will always agree on the value of I'm not entirely sure that it's worth allowing this level of granularity - it feels a little hard to explain why some uses of |
moved to sdk: dart-lang/sdk#24712, dart-lang/sdk#25573 |
Provide an static checking option to throw an error on any code that may instantiate a reified dynamic. E.g.,
This depends on:
The text was updated successfully, but these errors were encountered: