diff options
author | Paul Phillips <paulp@improving.org> | 2012-09-20 09:53:39 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-09-20 09:53:39 -0700 |
commit | 3136e53e0ce4d73e1d2b3e8d043fff7892b2f439 (patch) | |
tree | 69e6e4c21241e174942bce493aec289b46a6dce9 /test/files/neg/valueclasses-pavlov.scala | |
parent | d834d90d88e1dab6a8621b13c9d4b64d3417a94e (diff) | |
parent | d87592da76eb555f0e3fc3732169e56b1852fba1 (diff) | |
download | scala-3136e53e0ce4d73e1d2b3e8d043fff7892b2f439.tar.gz scala-3136e53e0ce4d73e1d2b3e8d043fff7892b2f439.tar.bz2 scala-3136e53e0ce4d73e1d2b3e8d043fff7892b2f439.zip |
Merge branch 'pull-1352-reformatted' into 2.10.x
# By Martin Odersky
* pull-1352-reformatted:
Disabled failing build manager tests.
New test case for SI-6337
New test case for closing SI-6385
Value classes: eliminated half-boxing
Cleanup of OverridingPairs
Fixes SI-6260
Diffstat (limited to 'test/files/neg/valueclasses-pavlov.scala')
-rw-r--r-- | test/files/neg/valueclasses-pavlov.scala | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/files/neg/valueclasses-pavlov.scala b/test/files/neg/valueclasses-pavlov.scala new file mode 100644 index 0000000000..a5858b2cf0 --- /dev/null +++ b/test/files/neg/valueclasses-pavlov.scala @@ -0,0 +1,23 @@ +trait Foo[T <: AnyVal] extends Any { + def foo(x: String): String + def foo(x: T): String +} + +class Box1(val value: String) extends AnyVal with Foo[Box2] { + def foo(x: String) = "foo(String): ok" + def foo(x: Box2) = "foo(Box2): ok" +} + +class Box2(val value: String) extends AnyVal + + +object test2a { + + def main(args: Array[String]) { + val b1 = new Box1(null) + val b2 = new Box2(null) + val f: Foo[Box2] = b1 + println(f.foo("")) + println(f.foo(b2)) + } +} |