-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Field-less mixins allowed for const constructors #32223
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
Ping? Why is this closed? This is still (AFAIK) the best way towards allowing classes with mixins to have const constructors. |
Thanks for the ping, @noinskit. I believe the issue is closed because the described functionality is implemented. For example, the following bash session demonstrates a Dart program using const constructors in a subclass of anonymous mixin application:
|
@eernstg I have issues with understanding the spec change, the wording seems inconsistent, and confusing. For constructors with all required positional parameters its says |
You're right, this part of the specification needs to be clarified. I've created dart-lang/language#769 in order to track this work. For now, I hope the following will be helpful: At first sight it might seem unimportant whether we say The intended semantics is that the code of members when added to |
@scheglov, I haven't reopened this issue: If the current behavior of the front end conflicts with the specification including the above sketch of a clarification I believe we might as well handle that in a new issue. |
Why does
result in
If I remove the line with |
In response to the request in #9745, #28492, and more, and cf. the language specification update in 63c6851, constructor forwarding should now support the creation of constant forwarding constructors in the case where the applied mixin does not declare any instance variables.
The text was updated successfully, but these errors were encountered: