Skip to content

Add mode bit to track whether we are in safe nulls mode #11195

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

Merged
merged 4 commits into from
Feb 1, 2021

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jan 23, 2021

The bit is set if

  • -Yexplicit-nulls is set
  • we are not in an import.unsafeNulls scope

@odersky
Copy link
Contributor Author

odersky commented Jan 23, 2021

@noti0na1 This might be a good basis for the explicit-nulls PR.

@noti0na1
Copy link
Member

@odersky Thanks! I will take a look

@noti0na1
Copy link
Member

I have merged this branch into my PR.
One small modification is required: when we add the SafeNulls bit, we also need to check the unsafeNulls language feature is not set globally.
It seems we can use the new Mode bit to check UnsafeNulls at all places. The StickyKey is no longer needed as well.

Make sure that something is a language import if and only if it
looks like one. i.e. is of one of the forms

    import language.xyz
    import scala.language.xyz
    import _root_.scala.language.xyz
Avoid a notation of "owner" when checking for a language feature. Instead,
allow qualified names for language features, e.g. `experimental.dependent".
The bit is set if

 - -Yexplicit-nulls is set
 - we are not in an `import.unsafeNulls` scope
@odersky odersky merged commit 3b741d6 into scala:master Feb 1, 2021
@odersky odersky deleted the add-safenull-mode branch February 1, 2021 18:37
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
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.

3 participants