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

Overload resolution between outer scope and inherited scope fails #8914

Closed
martijnhoekstra opened this issue May 8, 2020 · 2 comments
Closed

Comments

@martijnhoekstra
Copy link
Contributor

martijnhoekstra commented May 8, 2020

Minimized code

abstract class A {
  protected[this] def m(): Int = 1
}

object B {
  private def m(i: Int) = 2
  private final class Composite() extends A {
    def test = m()
  }
}

Output

Reference to m is ambiguous,
it is both defined in object B
and inherited subsequently in class Composite

Expectation

Compilation to succeed, like in scala 2

@martijnhoekstra
Copy link
Contributor Author

workaround: this.m()

@smarter
Copy link
Member

smarter commented May 8, 2020

That particular change is intentional: #8622, sorry I didn't realize this is what you meant on gitter.

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

No branches or pull requests

3 participants