-
-
Notifications
You must be signed in to change notification settings - Fork 670
BREAKING CHANGE: Make class fields a special kind of property #2548
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
Conversation
that also work with interfaces
Last commit bakes in static |
(for some reason this one doesn't show as merged as usual but is still open, so closing manually) |
BREAKING CHANGE: Element kinds FIELD and FIELD_PROTOTYPE and elements Field and FieldPrototype have been removed. Instead, Property inherit previous Field functionality, indicated by property.isField.
Removes the hard distinction between fields, i.e.
and properties, i.e.
by making fields special kinds of properties, differing in having an associated memory offset. As a result, fields (which get built-in getters and setters) and properties (with explicit getters and setters) can override each other, lifting the annoying limitation that interface fields can only be implemented with properties. Since interchangeable fields and properties are more powerful than what is possible in JS/TS, compatibility with TS becomes a matter of disallowing what wouldn't be supported there due to JS nature.