diff options
author | Paul Phillips <paulp@improving.org> | 2010-03-21 00:22:22 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-03-21 00:22:22 +0000 |
commit | 3d7e9c11ad92b125ae5c34105e8799cd5fbdaf7c (patch) | |
tree | a4807feda58d68265cd8f515b185f43737e723dc /test | |
parent | 6353b3711f63218e684f1498697eaf71e0c4bb53 (diff) | |
download | scala-3d7e9c11ad92b125ae5c34105e8799cd5fbdaf7c.tar.gz scala-3d7e9c11ad92b125ae5c34105e8799cd5fbdaf7c.tar.bz2 scala-3d7e9c11ad92b125ae5c34105e8799cd5fbdaf7c.zip |
During my last look at r21224 I noticed what mu...
During my last look at r21224 I noticed what must be a long standing
bug in Array.update handling. Fixing this probably never to be noticed
corner case (see bug3175.scala) seduced me into drumming out some
duplication. At least we got some nice commenting out of it. Review by
dubochet.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/bug3175.check | 3 | ||||
-rw-r--r-- | test/files/run/bug3175.scala | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/test/files/run/bug3175.check b/test/files/run/bug3175.check index daf2c23ab5..12246140f4 100644 --- a/test/files/run/bug3175.check +++ b/test/files/run/bug3175.check @@ -6,3 +6,6 @@ 5 5 5 +100 +jabooboo +hi mom diff --git a/test/files/run/bug3175.scala b/test/files/run/bug3175.scala index 9cccff52f9..78660d4085 100644 --- a/test/files/run/bug3175.scala +++ b/test/files/run/bug3175.scala @@ -17,6 +17,11 @@ object Test { def f9(x: { def apply(x: Int): Int }) = x(0) def f10(x: { def apply(x: Int): Long }) = x(0) + // update has some interesting special cases + def f11(x:{ def update(x: Int, y: Long): Any }, y: Long) = x(0) = y + def f12(x:{ def update(x: Int, y: String): AnyVal }, y: String) = x(0) = y + def f13(x:{ def update(x: Int, y: String): AnyRef }, y: String) = x(0) = y + // doesn't work yet, see #3197 // def fclone(x:{ def clone(): AnyRef }) = x.clone() @@ -40,5 +45,11 @@ object Test { println(f8(Array(5))) println(f9(Array(5))) println(f10(Array(5))) + + f11(longs, 100L) + f12(strs, "jabooboo") + println(longs(0)) + println(strs(0)) + f13(new { def update(x: Int, y: String): List[Int] = { println("hi mom") ; Nil } }, "irrelevant") } } |