-
Notifications
You must be signed in to change notification settings - Fork 205
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
Inconsistencies around the interface of Null. #2759
Comments
The current language specification says that The language specification under review, with null safety updates say that
I'd prefer to have a plain, named top type, with the same semantics as However, the current description, in the version with null safety, yields the same results. In particular, This is also consistent with
However, the dartdoc entry should not imply that anything in @lrhn, that sounds like a somewhat gnarly problem, because we can't say that the members of |
We have type hierarchy with an infinity of top types ( I'd probably try to define the |
Consider the following:
This program compiles and prints true. However, If we look into the API of Null (go to declaration), it does not contain a
==
member and its comment says:The subtyping rules document confirm the validity of that comment i.e. quote: The type Object is the super type of all concrete types except Null.
I'm assuming that ==, runtimeType and noSuchMethod exists on 'values' because they are subtypes of Object, so this seems odd to me.
Also, dartdoc says that these members have been inherited (from
Object
?).I think a clean solution would be to add the missing members to the interface of Null, and perhaps to have an empty not-quite-top type e.g. #2756 to denote that Null is not an Object?
The text was updated successfully, but these errors were encountered: