-
Notifications
You must be signed in to change notification settings - Fork 86
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
Add the list of attributes that support nullable analysis. #1191
base: draft-v8
Are you sure you want to change the base?
Conversation
Include all the nullable analysis attributes in the spec. This will be edited heavily and shrunk down to a smaller set of normative text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An early review, just comments. In general I’m not sure the must/may language is correct. I haven’t gone through all the examples so no comments there but a glance suggests I'd have similar queries – but examples are informative…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just another bunch of comments
Co-authored-by: Nigel-Ecma <[email protected]> Co-authored-by: Jon Skeet <[email protected]>
Co-authored-by: Jon Skeet <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more suggested change, but basically fine. (Thanks!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple more comments
Co-authored-by: Nigel-Ecma <[email protected]>
standard/attributes.md
Outdated
> } | ||
> ``` | ||
> | ||
> The presence of the attribute helps the compiler in a number of ways. First, the compiler can issue a warning if there's a path where the method can exit without throwing an exception. Second, the compiler can consider any code after a call to that method as unreachable, until an appropriate catch clause is found. Third, the unreachable code won't affect any null states. *end example* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be reworded. The compiler doesn't use this attribute for definite assignment nor reachability. However, it will only supress any nullability.
When the `DoesNotReturn` attribute is parsed by a compiler that provides nullable diagnostics, that attribute can't impact reachable code analysis.
Fixes #1092
Based on the last meeting, list the attributes so that their function is normative, however a compiler need not issues warnings based on these rules.