Skip to content

Fix #2395: Check if the scala or dotty libraries are missing #3045

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
Sep 5, 2017

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

val paths = Jars.dottyTestDeps map { p =>
val classPath = mkClassPath(Jars.dottyTestDeps)

def mkClassPath(deps: List[String]) = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Explicit return type?

Copy link
Contributor

@allanrenucci allanrenucci left a comment

Choose a reason for hiding this comment

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

LGTM. But someone with a better understanding of compiler internals should have a look.

@@ -1199,7 +1199,10 @@ object Denotations {
val alt =
if (generateStubs) missingHook(owner.symbol.moduleClass, selector)
else NoSymbol
if (alt.exists) alt.denot else MissingRef(owner, selector)
if (alt.exists) alt.denot
else if (owner.symbol == defn.RootClass && (selector == nme.scala_ || selector == nme.scalaShadowing))
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe document what this test or extract it to an inner function.

I don't have a good understanding of this does though. @smarter?

if (alt.exists) alt.denot else MissingRef(owner, selector)
if (alt.exists) alt.denot
else if (isPackageFromCoreLibMissing) throw new MissingCoreLibraryException(selector.toString)
else MissingRef(owner, selector)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@smarter could you review the isPackageFromCoreLibMissing condition in this file. Thanks.

Copy link
Member

Choose a reason for hiding this comment

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

Looks fine to me.

@@ -1192,14 +1192,23 @@ object Denotations {
def staticRef(path: Name, generateStubs: Boolean = true, isPackage: Boolean = false)(implicit ctx: Context): Denotation = {
def select(prefix: Denotation, selector: Name): Denotation = {
val owner = prefix.disambiguate(_.info.isParameterless)
def isPackageFromCoreLibMissing: Boolean = {
owner.symbol == defn.RootClass &&
{
Copy link
Member

Choose a reason for hiding this comment

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

Use ( not {

@nicolasstucki
Copy link
Contributor Author

Rebased after drone update

@allanrenucci allanrenucci merged commit 717904b into scala:master Sep 5, 2017
@allanrenucci allanrenucci deleted the fix-#2395 branch December 14, 2017 19:18
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