Skip to content

Instantly share code, notes, and snippets.

@paulp
Created February 10, 2014 01:01
Show Gist options
  • Save paulp/8908555 to your computer and use it in GitHub Desktop.
Save paulp/8908555 to your computer and use it in GitHub Desktop.
package p {
trait N { type Name ; def make(): Name }
trait N1 extends N { class Name ; def make(): Name = new Name }
trait N2 extends N { class Name }
object g extends App with N1 with N2 {
val x = (this: N2).make()
// java.lang.ClassCastException: p.N1$Name cannot be cast to p.N2$Name
}
}
@holograph
Copy link

Ugh. Can't recall what link brought me here, but this definitely seems like a bug. Is there already an open issue?

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