Skip to content

update @immutable to support mixins #48404

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

Closed
pq opened this issue Feb 15, 2022 · 1 comment
Closed

update @immutable to support mixins #48404

pq opened this issue Feb 15, 2022 · 1 comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams.

Comments

@pq
Copy link
Member

pq commented Feb 15, 2022

With enhanced enums, it should be legal to annotate mixins.

For example:

@immutable
enum E {
  e(1), f(2), g(3);
  final int key;
  const E(this.key);
  bool operator ==(Object other) => other is E && other.key == key;
  int get hashCode => key.hashCode;
}

(Currently produces the diagnostic: "Only classes can be annotated as being immutable.")

See: #58586

@pq pq added area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. pkg-meta labels Feb 15, 2022
@pq
Copy link
Member Author

pq commented Feb 15, 2022

(whoops!)

@pq pq closed this as completed Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams.
Projects
None yet
Development

No branches or pull requests

1 participant