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

Explicitly state empty package in extendedLocationText #18748

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Oct 23, 2023

   |              ^^^^^^^^^^^^^
   |              Found:    Byte
   |              Required: Byte²
   |
   |              where:    Byte  is a class in package scala
+  |                        Byte² is a class
-  |                        Byte² is a class in the empty package

@@ -601,6 +601,8 @@ class PlainPrinter(_ctx: Context) extends Printer {

def extendedLocationText(sym: Symbol): Text =
if (!sym.exists) ""
else if isEmptyPrefix(sym.owner) then
" in the root package"
Copy link
Member

@bishabosha bishabosha Oct 24, 2023

Choose a reason for hiding this comment

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

shouldn't it be the empty package? SLS 9.2:

Top-level definitions outside a packaging are assumed to be injected into a special empty package. That package cannot be named and therefore cannot be imported. However, members of the empty package are visible to each other without qualification.

Suggested change
" in the root package"
" in the empty package"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@nicolasstucki nicolasstucki changed the title Explicitly state root package in extendedLocationText Explicitly state empty package in extendedLocationText Oct 24, 2023
@nicolasstucki nicolasstucki merged commit 6b8b02d into scala:main Oct 24, 2023
16 checks passed
@nicolasstucki nicolasstucki deleted the improve-18678 branch October 24, 2023 10:27
@Kordyjan Kordyjan added this to the 3.4.0 milestone Dec 20, 2023
WojciechMazur added a commit that referenced this pull request Jun 23, 2024
…LTS (#20734)

Backports #18748 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
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