Skip to content

Instantly share code, notes, and snippets.

@VladUreche
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VladUreche/9515271 to your computer and use it in GitHub Desktop.
Save VladUreche/9515271 to your computer and use it in GitHub Desktop.
$ cat C.scala
class C[@specialized T](t: T)
class D[@specialized T](t: T) extends C[T](t)
$ scalac C.scala
C.scala:2: warning: class C must be a trait. Specialized version of class D will inherit generic C[Boolean]
class D[@specialized T](t: T) extends C[T](t)
^
one warning found
$ cat D.scala
object Test extends App {
val x=new D(3)
println(x.getClass)
println(x.getClass.getSuperclass)
println(x.getClass.getSuperclass.getSuperclass)
}
$ scalac D.scala
$ scala Test
class D$mcI$sp
class D
class C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment