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

Make mixin and interface a builtin identifier or reserved word #33113

Closed
3 tasks done
leafpetersen opened this issue May 14, 2018 · 2 comments
Closed
3 tasks done

Make mixin and interface a builtin identifier or reserved word #33113

leafpetersen opened this issue May 14, 2018 · 2 comments
Assignees
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language).
Milestone

Comments

@leafpetersen
Copy link
Member

leafpetersen commented May 14, 2018

We should reserve these now for future compatibility (i.e. with the upcoming mixin feature).

Is builtin identifier enough, or do we need this to be a reserve word?

cc @lrhn @eernstg

Update: Make them builtin identifiers.

@leafpetersen leafpetersen added the area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). label May 14, 2018
@leafpetersen leafpetersen added this to the Dart2Stable milestone May 14, 2018
@leafpetersen leafpetersen self-assigned this May 14, 2018
@lrhn
Copy link
Member

lrhn commented May 15, 2018

I believe being a built-in identifier is enough. The words are only expected at the beginning of a top-level declaration (likely not even preceded by abstract), so preventing them from being types or prefixes will allow us to recognize their meaning immediately.

Making them reserved words is a much more breaking change, since it would break existing code that uses the names as variables or class members. Such code exists.

@peter-ahe-google

@leafpetersen
Copy link
Member Author

Concretely (for reference) all of the following will become errors (and similarly for interface):

import "dart:core" as mixin;

typedef mixin(x);

class mixin {}

class Foo<mixin> {}

@dart-bot dart-bot added this to Done in 2.0 language via automation May 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language).
Projects
No open projects
2.0 language
  
Done
Development

No branches or pull requests

2 participants