Last active
August 29, 2015 13:57
-
-
Save VladUreche/9515271 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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