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

Binding precedence not respected for enclosing package in unit #10662

Closed
som-snytt opened this issue Dec 18, 2017 · 2 comments · Fixed by scala/scala#7609
Closed

Binding precedence not respected for enclosing package in unit #10662

som-snytt opened this issue Dec 18, 2017 · 2 comments · Fixed by scala/scala#7609
Assignees
Labels
Milestone

Comments

@som-snytt
Copy link

Even after #2458 the implementation still won't respect p.X, as it only looks for the first definition from enclosing scopes. The reference should be ambiguous because p.q.X is defined elsewhere.

package p {

  class X {
    override def toString() = "p.X"
  }

  package q {
    //import p.X  // "permanently hidden"
    object Test extends App {
      println(new X)
    }
  }
}

and in a different compilation unit:

package p.q

class X { 
  override def toString() = "p.q.X"
} 
// similarly for package object q { type X = other }
@SethTisue
Copy link
Member

@som-snytt is scala/scala#7609 something you plan to return to, or is this up for grabs?

@som-snytt
Copy link
Author

I'll give it another shot. Thanks, I'd forgotten about this one, which was the final nail in spec chapter 2. I'd say it's up for grabs like the bouquet at a wedding, but does anyone really want to get tied down to a total leftover no one understands or cares about? Also, "A foreign definition induces ambiguity" is my other political joke.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants