-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Static getter or setter declaration doesn't add an instance one to the Type object #23721
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
Comments
Yes, the spec does indeed seem to imply that static members on classes become instance members on result of calling That's something we've talked about forever, but as far as I know, we did not decide to do that. The implementations certainly don't, so I don't see why the spec says they should. As far as I know, this should be removed from the spec. |
The spec also goes out of its way to make those getters and setters invisible again.
That's a roundabout way of saying that the getter on the In effect, it's indistinguishable from having Technically it's working as intended, but we might want to streamline the spec a little at some point in the future. |
No milestone now: This clarification should be considered and possibly performed, but this will not block Dart 2. |
All these sentences that amount to a specification of a kind of "meta classes" (where each |
Closing: All text concerned with "meta classes" has been removed from the language specification as of 614ae7f, in particular the text which gave rise to this issue. |
According Dart specification (2-n Edition, December 2014) p. 10.2
"The effect of a static getter declaration in class C is to add an instance getter with the same name and signature to the Type object for class C that forwards (9.1) to the static getter."
But in fact no getter/setter instance added to the Type object. The following code demonstrates the issue:
The text was updated successfully, but these errors were encountered: