Skip to content
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

Introduce NotNoneAttribute alias #1420

Merged
merged 10 commits into from
Apr 25, 2022
Merged

Conversation

BCSharp
Copy link
Member

@BCSharp BCSharp commented Apr 24, 2022

Resolves #1412.

@slozier
Copy link
Contributor

slozier commented Apr 25, 2022

NotNullOnReturn is something we want to keep? Or it's just to ease the PR review process?

@BCSharp
Copy link
Member Author

BCSharp commented Apr 25, 2022

It is an artifact of the way I was making the changes and testing them. I have it already removed locally. In general, I am not a big fan of renames, unless there is a really compelling reason to do so, like NotNone.

But to play devil's advocate: one possible reason to use NotNullOnReturn would be to be able to do that rename as global using, next to NotNone. Right now, if a file uses [NotNull] (from System.Diagnostics.CodeAnalysis) but also uses Microsoft.Scripting.Runtime namespace in the same file, there is a name ambiguity. To resolve that, the file still needs to declare
using NotNullAttribute = System.Diagnostics.CodeAnalysis.NotNullAttribute (or spell out the fully-qualified name). But since it only happens in a handful of files, I don't think it is worth to introduce a non-standard alias.

@slozier slozier mentioned this pull request Apr 25, 2022
8 tasks
@BCSharp BCSharp added this to the 3.4-beta milestone Apr 25, 2022
@BCSharp BCSharp marked this pull request as ready for review April 25, 2022 20:11
Copy link
Contributor

@slozier slozier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@slozier slozier merged commit 0529bde into IronLanguages:master Apr 25, 2022
@BCSharp BCSharp deleted the NotNone branch April 25, 2022 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confusing use of NotNullAttribute
2 participants