Skip to content

update @immutable to support mixins #48404

Closed
@pq

Description

@pq

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-pkgUsed for miscellaneous pkg/ packages not associated with specific area- teams.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions