Skip to content

Print missing package prefixes #6113

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 2 commits into from
Mar 19, 2019

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Mar 19, 2019

In some cases the missing prefix makes the recompilation test complain because of an unknown package.

@nicolasstucki nicolasstucki force-pushed the add-missing-package-prefix branch from 538b49c to 24e11f2 Compare March 19, 2019 08:20
val packagePath = sym.owner.fullName.stripPrefix("<root>").stripPrefix("<empty>").stripPrefix(".")
if (packagePath != "")
this += packagePath += "."
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering inside the if, what is the value of prefix at runtime?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is a Types.EmptyPrefix() as the pattern matching indicates.

Copy link
Contributor

Choose a reason for hiding this comment

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

If that is the case, it seems to me the type is ill-formed, the prefix is wrong -- or I misunderstood the invariant for TermRef. We can get this in to unblock other issues, but it would be nice to clarify the invariant about TermRef. /cc: @odersky .

Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

LGTM

@nicolasstucki nicolasstucki merged commit 97756a7 into scala:master Mar 19, 2019
@ghost ghost removed the stat:needs review label Mar 19, 2019
@liufengyun liufengyun deleted the add-missing-package-prefix branch March 19, 2019 10: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.

2 participants