-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some important packages fail to compile with Fasta #31756
Comments
|
You are right that the workaround for the first issue is to specify the return type @leafpetersen @eernstg @stereotype441 I'd like to make sure that we are implementing the intended behavior for the first issue. Here's the situation:
I talked to @lrhn and he suggested that Do we really want the requirement that the all the types are equal? Since we've (as far as I understand) decided that classes can inherit multiple instantiations of the same type, I think this will make using type-inference on those inherited methods a compile-time error. |
The second issue, the one in package test, is a bug in our implementation. I'm working on a fix. |
If a class (1): ... and if any of the super-interface signatures of |
In this case, the class |
I like the idea of inferring the return type of |
I have a CL that fixes the second problem, the one with package test, at https://dart-review.googlesource.com/c/sdk/+/32620. I'll update this issue when it lands. |
The question of what to do when you inherit "equivalent" but not "equal" types is irritating. We could choose an ordering on the the simple types (e.g. prefer |
For equivalent-but-not-equal types, consistently picking any of them is likely good enough. If you always pick the syntactically last one, you can rearrange to put the interface of the one you want at the end (unless it's the one from the superclass, then you're out of luck). For a normal class declaration you can add an abstract override in the body. For a mixin application class, you can add an interface if necessary. |
We have certain significant distinctions between types that are equivalent according to the subtype relation, and then we also have some accidental ones. In particular, general rules for union types justify conclusions such as In contrast, It's tempting to introduce a "micro structure" into the type system and say something like "Object <: dynamic <: void", hoping that this could give is reasonable specificity rules for computation of class interfaces (so For subtyping, of course, we should still simply ignore the difference between all top types (I've been doing a lot of experiments with voidness preservation, and I do not think there is any subtype (micro) structure which will give us the desired outcome, i.e., voidness preservation cannot simply be expressed as "the usual subtype rules, just taking the micro structure into account"). My current stance is that we ought to try using a micro structure on subtyping (possibly "Object <: dynamic <: void") at least for specificity & interface computations, but we should be prepared to have completely separate treatment of these non-subtype type distinctions for some other purposes. |
yaml
,pool
, andtest
packages fail to run with "Dart 2" VM. I'm not sure whether the following issues are caused by the compiler or packages sources should be updated.The first error could be "fixed" by specifying
void
return type onoperator []=
, the third one seems to be similar to #31743./cc @mraleph
The text was updated successfully, but these errors were encountered: