immutable top-level constant
Immutable
const immutable
Annotation on an immutable class.
Used to annotate a class declaration.
Indicates that the class, and all subtypes of it, must be immutable.
A class is immutable if all of the instance fields of the class, whether
defined directly or inherited, are final.
Tools, such as the analyzer, can provide feedback if
- the annotation is associated with anything other than a class, or
- a class that has this annotation or extends, implements or mixes in a class that has this annotation is not immutable.
Implementation
const Immutable immutable = Immutable();