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

Don't warn about compromised extension of sealed/final hierarchy #11835

Open
som-snytt opened this issue Dec 23, 2019 · 0 comments
Open

Don't warn about compromised extension of sealed/final hierarchy #11835

som-snytt opened this issue Dec 23, 2019 · 0 comments

Comments

@som-snytt
Copy link

@som-snytt som-snytt commented Dec 23, 2019

Since questions of access and leaking types can be vexing, the compiler should offer maximum support and not lint about extensions which are not allowed.

scala> :paste -raw
// Entering paste mode (ctrl-D to finish)

package p {
  private[p] class D
  sealed trait T { def f(d: D): Unit }
  final class C extends T { def f(d: D) = () }
}

// Exiting paste mode, now interpreting.


  sealed trait T { def f(d: D): Unit }
                       ^
<pastie>:3: warning: method f in trait T references private[p] class D.
Classes which cannot access D may be unable to provide a concrete implementation of f.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.