-
Notifications
You must be signed in to change notification settings - Fork 1.7k
kernel: Do not abstract and share mixin applications #31118
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
Comments
Preferred name would be: "Object with Mixin1, Mixin2 for Subclass" |
Workaround for Issue #31118 Change-Id: I1d19eb1adeb7236501c276eeee5446ada36115a3 Reviewed-on: https://dart-review.googlesource.com/31240 Reviewed-by: Emily Fortuna <[email protected]> Commit-Queue: Sigmund Cherem <[email protected]>
Aske, could you take a look at this? |
I already took a stab at implementing the semantics dart2js need: https://dart-review.googlesource.com/c/sdk/+/17882 For this CL to land, we'd need to keep the old behavior and introduce a flag in pkg/kernel/lib/target/targets.dart that we can use to pick the desired implementation. However, Stephen reported that:
|
We may be in luck and be able to use the approach taken in https://dart-review.googlesource.com/c/sdk/+/33884 |
Fixed in 9f56e28. |
dart2js is blocked on this issue.
Consider:
What we see is that
One<int> with TheMixin<T>
is abstracted like soThis breaks on dart2js. dart2js has a constraint that a class cannot implement a type with different parameterizations. (The constraint allows the relationship between
Two
andOne
to be expressed as a function, the existence of this function is fundamental to the whole type representation.)However, the introduced type
OneWithTheMixin
implementsOne<U>
andOne<int>
. In particular, the raw typeOneWithTheMixin
implementsOne<dynamic>
andOne<int>
.The simplest for dart2js would be to create a fresh class for each
with
. This is what the old pipeline does - so it would be an advantage to do the same (we can compare outputs), and then reconsider a version of this abstraction later when we are done with the transition to Kernel.This issue is blocking our next step, compiling angular apps with dart2js-with-kernel, so it is our highest priority issue with kernel.
The text was updated successfully, but these errors were encountered: