diff options
author | Martin Odersky <odersky@gmail.com> | 2012-02-15 18:12:17 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2012-02-15 18:12:34 +0100 |
commit | 186d8554456b6a2d024ada1bd2dd1a29cc0c430f (patch) | |
tree | b0d863c596ec5515b88c13c6307c6586bb1dc24f /test/files/run | |
parent | d638588797bff0998b588ba3552e6caefbf7b8e3 (diff) | |
download | scala-186d8554456b6a2d024ada1bd2dd1a29cc0c430f.tar.gz scala-186d8554456b6a2d024ada1bd2dd1a29cc0c430f.tar.bz2 scala-186d8554456b6a2d024ada1bd2dd1a29cc0c430f.zip |
Trying generic value classes. Does not work yet, but fixed on bug already.
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/GenericValueClass.scala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/files/run/GenericValueClass.scala b/test/files/run/GenericValueClass.scala new file mode 100644 index 0000000000..10068d6cae --- /dev/null +++ b/test/files/run/GenericValueClass.scala @@ -0,0 +1,12 @@ +class Box[T](val x: T) extends AnyVal { + def get: T = x +} + +object Test extends App { + val b = new Box(1) + println(b.get) + + val c = new Box("abc") + println(c.get) + +} |