-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Make mixins forward const constructors. #9745
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
Labels
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
P2
A bug or feature request we're likely to work on
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Comments
Issue #18707 has been merged into this issue. |
Removed this from the Later milestone. |
Removed Oldschool-Milestone-Later label. |
Issue #29396 was closed as a duplicate of this one; check out that issue for the example. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
P2
A bug or feature request we're likely to work on
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Currently mixin application is specified as creating forwarding constructors for all generative constructors of the superclass.
The created constructors are not const constructors, making it impossible to create a const class with a mixin.
If the superclass constructor is a const constructor, and the mixin doesn't add any fields, please make the created constructor also a const constructor. That would make it possible to create a const class using a mixin:
class EmptyList<E> extends Object with ImmutableListMixin<E> {
int get length => 0;
int operator[](int i) { throw new RangeError.value(i); }
}
... return const EmptyList(); ...
Not having const constructors makes mixins less useful.
The text was updated successfully, but these errors were encountered: