-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Create an issue #51365
Comments
The syntax Anyway, we don't have that yet. This means that there is no shared supertype of The way this situation is described in the DartDoc documentation of the classes Hence, I think the best way to proceed is to maintain that the language specification needs to specify this in a consistent and readable/non-surprising manner, and then we'll update the DartDoc. |
Here is the Null class code: @pragma("vm:entry-point")
class Null {
factory Null._uninstantiable() {
throw UnsupportedError('class Null cannot be instantiated');
}
external int get hashCode;
/// Returns the string `"null"`.
String toString() => "null";
} There is no == operator, but the following expression is valid. if(null == variableName) {} The analyser does not generate an error because the == operator is undefined on the Null type. It doesn't stop you from writing programs, but it's still pretty weird. |
You can't rely on the source code in platform libraries. Many of those declarations (and certainly The fact that we can invoke This is not going to go away, the platform libraries will inevitably introduce certain declared names whose semantics cannot be expressed in the language itself. |
Very often reading the source code can be clearer than the documentation, for this reason I hope that such an exception only applies to some special cases that are mentioned in the documentation somewhere. I note that the documentation in dart is quite good. |
Thanks for the kind words! - good documentation is certainly important. It's not easy to give precise promises about which parts of the platform source code is "magical" (that is, the tool chain "knows" about specific declarations and gives them special treatment), but the 'sdk' directory contains about 216542 lines of code, which would be an upper bound. A lower bound could be any platform code which is dealing with types mentioned in the language specification (like |
.....
The text was updated successfully, but these errors were encountered: