Skip to content

Crash when a class extends a trait with a member signature that contains a private type member #1130

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

Closed
smarter opened this issue Feb 29, 2016 · 0 comments

Comments

@smarter
Copy link
Member

smarter commented Feb 29, 2016

trait A {
  private type Foo = Int

  def foo: Foo = 1
}
class B extends A

fails to compile with

dotty.tools.dotc.core.Types$MissingType: cannot resolve reference to type B(B.this).Foo
the classfile defining the type might be missing from the classpath

Full stack trace: https://gist.github.com/smarter/6a7a6d840ce0f37b1d12

Note that even if we disallow using private types in signatures, we still have to deal with traits coming from Scala 2 where this is allowed, the following fails in exactly the same way:

abstract class Foo extends scala.collection.mutable.IndexedSeqView[Nothing, Nothing]
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

2 participants