Skip to content
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

Mixin applications should support const constructors. #35548

lrhn opened this issue Jan 3, 2019 · 2 comments


None yet
3 participants
Copy link

commented Jan 3, 2019

The specification states that a mixin application of a mixin that contains no instance variable declarations will forward const constructors as const constructors.
The analyzer does not support this, instead it gives the error

Const constructor can't be declared for a class with a mixin that declares a field.

The front-end supports the feature, but the analyzer is preventing us from using it.
(See, e.g., this CL).

@scheglov scheglov self-assigned this Jan 7, 2019


This comment has been minimized.

Copy link

commented Jan 7, 2019

I think that the CL you are referencing has errors reported by Analyzer because it has static fields.

The spec does not make distinction between instance and static fields.
It seems that static fields should not matter, but it is not specified explicitly.

I will prepare a CL to ignore static fields for the purpose of checking for this error.


This comment has been minimized.

Copy link

commented Jan 7, 2019

dart-bot pushed a commit that referenced this issue Jan 7, 2019

…n mixin has a static field.

Bug: #35548
Change-Id: I46a2006574e31505a860a9e54640b643bb514ae7
Commit-Queue: Konstantin Shcheglov <>
Reviewed-by: Brian Wilkerson <>

@scheglov scheglov closed this Jan 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.