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

Make members of the empty package invisible from inside other packages #13593

Merged
merged 2 commits into from Sep 24, 2021

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Sep 23, 2021

Fixes #13114
Fixes #7891

Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

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

LGTM!

tests/neg/i13114/B.scala Show resolved Hide resolved
Also make toplevel non-class definitions in the empty package invisible from nested packages.
@odersky
Copy link
Contributor Author

odersky commented Sep 24, 2021

@dwijnand Good point about #7891. With a bit of refinement this is handled now as well.

@dwijnand
Copy link
Member

OK, so classes in the empty package in difference files can still see each other? For some reason I thought that every file kind of got it's own "fresh" empty package scope. I don't know what problem I'm solving with that enforcement, so LGTM!

@dwijnand dwijnand merged commit a4f2671 into scala:master Sep 24, 2021
@dwijnand dwijnand deleted the fix-13114 branch September 24, 2021 10:37
@odersky
Copy link
Contributor Author

odersky commented Sep 24, 2021

Yes classes in the empty package can see each other, whether they are compiled separately or not. That's how it's specced in Java as well.

@Kordyjan Kordyjan added this to the 3.1.1 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
3 participants