TLDR: If your code uses
mixin or
interface as a prefix, class, type parameter or typedef name, then your code will soon break. Otherwise you can stop reading.
What's changing?
We are adding mixin and interface to the list of built-in identifiers in Dart. This means that those names will no longer be allowed to be used as a prefix, class name, type parameter name or typedef name.
What will break?
Using the mixin or interface identifiers as a prefix:
import "dart:core" as mixin;
as a typedef name:
as a class name:
or as a type parameter name:
will become a compile time error.
With the exception of prefixes, none of these uses are consistent with Dart naming conventions and so we expect breakage to be rare.
How do I know if this has broken me?
If you see an error that looks something like the following:
error • The built-in identifier 'mixin' can't be used as a prefix name at /Users/leafp/tmp/ddctest.dart:1:23 • built_in_identifier_as_prefix_name
then you are probably running into this.
How do I fix this?
If you are using these identifiers as prefixes (the most likely case) or a type parameter name you can simply choose a new name without affecting your API. If you are using these identifiers as class names or typedef names (why!?) then you may need to make a breaking change to your API.
Why is this change being made?
We plan on adding explicit syntax for mixins to support the super-mixin feature as part of Dart 2 in the next update release. We anticipate the possibility of doing something similar with interfaces in the future. To support both of these use cases, we are making mixin and interface built-in identifiers now to avoid breakage in the future.
thanks,
-leaf