diff options
author | Paul Phillips <paulp@improving.org> | 2012-02-19 00:03:55 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-02-19 00:19:12 -0800 |
commit | 87e369ef46bd2ca569ffd1cd6f3a554f1d645dc9 (patch) | |
tree | 4e3ab65d04eefe10a49ee97bcca254f10db1c52f | |
parent | ec160bae7e2935d98bf71cfb6dcba61f1979b854 (diff) | |
download | scala-87e369ef46bd2ca569ffd1cd6f3a554f1d645dc9.tar.gz scala-87e369ef46bd2ca569ffd1cd6f3a554f1d645dc9.tar.bz2 scala-87e369ef46bd2ca569ffd1cd6f3a554f1d645dc9.zip |
More specialization tests.
Some in pending, some in files. Closes SI-4770.
-rw-r--r-- | test/files/run/t3575.check | 16 | ||||
-rw-r--r-- | test/files/run/t3575.scala | 55 | ||||
-rw-r--r-- | test/files/run/t4770.check (renamed from test/pending/run/t4770.check) | 0 | ||||
-rw-r--r-- | test/files/run/t4770.scala (renamed from test/pending/run/t4770.scala) | 0 | ||||
-rw-r--r-- | test/pending/pos/t4123.scala | 14 | ||||
-rw-r--r-- | test/pending/pos/t4436.scala | 3 | ||||
-rw-r--r-- | test/pending/pos/t4717.scala | 7 | ||||
-rw-r--r-- | test/pending/pos/t4787.scala | 4 |
8 files changed, 93 insertions, 6 deletions
diff --git a/test/files/run/t3575.check b/test/files/run/t3575.check index c240b3d90c..9080fd8674 100644 --- a/test/files/run/t3575.check +++ b/test/files/run/t3575.check @@ -2,3 +2,19 @@ Two Two Two Two$mcII$sp +TwoLong +TwoLong$mcIL$sp +TwoLong$mcLI$sp +TwoLong$mcII$sp +TwoCool +TwoCool$mcIL$sp +TwoCool$mcLI$sp +TwoCool$mcII$sp +TwoShort +TwoShort +TwoShort +TwoShort$mcII$sp +TwoMinimal +TwoMinimal$mcIL$sp +TwoMinimal$mcLI$sp +TwoMinimal$mcII$sp diff --git a/test/files/run/t3575.scala b/test/files/run/t3575.scala index 56950e62bb..9ccd90a8c4 100644 --- a/test/files/run/t3575.scala +++ b/test/files/run/t3575.scala @@ -1,12 +1,55 @@ -case class Two[@specialized A, @specialized B](v: A, w: B); - // This is here to tell me if the behavior changes, not because // the output is endorsed. +case class Two[ + @specialized A, + @specialized B +](v: A, w: B) + +case class TwoLong[ + @specialized(Char, Boolean, Byte, Short, Int, Long, Float, Double, Unit, AnyRef) A, + @specialized(Char, Boolean, Byte, Short, Int, Long, Float, Double, Unit, AnyRef) B +](v: A, w: B) + +case class TwoCool[ + @specialized(Specializable.Everything) A, + @specialized(Specializable.Everything) B +](v: A, w: B) + +case class TwoShort[ + @specialized() A, + @specialized() B +](v: A, w: B) + +case class TwoMinimal[ + @specialized(Int, AnyRef) A, + @specialized(Int, AnyRef) B +](v: A, w: B) + object Test { def main(args: Array[String]): Unit = { - println(Two("Hello", 12).getClass().getName()) - println(Two(12, "Hello").getClass().getName()) - println(Two("Hello", "World").getClass().getName()) - println(Two(12, 12).getClass().getName()) + println(Two("Hello", "World").getClass().getName()); + println(Two(12, "Hello").getClass().getName()); + println(Two("Hello", 12).getClass().getName()); + println(Two(12, 12).getClass().getName()); + + println(TwoLong("Hello", "World").getClass().getName()); + println(TwoLong(12, "Hello").getClass().getName()); + println(TwoLong("Hello", 12).getClass().getName()); + println(TwoLong(12, 12).getClass().getName()); + + println(TwoCool("Hello", "World").getClass().getName()); + println(TwoCool(12, "Hello").getClass().getName()); + println(TwoCool("Hello", 12).getClass().getName()); + println(TwoCool(12, 12).getClass().getName()); + + println(TwoShort("Hello", "World").getClass().getName()); + println(TwoShort(12, "Hello").getClass().getName()); + println(TwoShort("Hello", 12).getClass().getName()); + println(TwoShort(12, 12).getClass().getName()); + + println(TwoMinimal("Hello", "World").getClass().getName()); + println(TwoMinimal(12, "Hello").getClass().getName()); + println(TwoMinimal("Hello", 12).getClass().getName()); + println(TwoMinimal(12, 12).getClass().getName()); } } diff --git a/test/pending/run/t4770.check b/test/files/run/t4770.check index 38e5a831fa..38e5a831fa 100644 --- a/test/pending/run/t4770.check +++ b/test/files/run/t4770.check diff --git a/test/pending/run/t4770.scala b/test/files/run/t4770.scala index 25bf3050c3..25bf3050c3 100644 --- a/test/pending/run/t4770.scala +++ b/test/files/run/t4770.scala diff --git a/test/pending/pos/t4123.scala b/test/pending/pos/t4123.scala new file mode 100644 index 0000000000..82ab16b4e4 --- /dev/null +++ b/test/pending/pos/t4123.scala @@ -0,0 +1,14 @@ +// /scala/trac/4123/a.scala +// Sun Feb 19 00:08:53 PST 2012 + +trait Iter[@specialized(Byte) +A] extends Iterator[A] { + self => + + override def map[B](f: (A) => B) = super.map(f) +} + +class ByteIter extends Iter[Byte] { + var i = 0 + def hasNext = i < 3 + def next = { i += 1 ; i.toByte } +}
\ No newline at end of file diff --git a/test/pending/pos/t4436.scala b/test/pending/pos/t4436.scala new file mode 100644 index 0000000000..acbf0beae6 --- /dev/null +++ b/test/pending/pos/t4436.scala @@ -0,0 +1,3 @@ +trait Chunk[@specialized +A] { + def bippy[@specialized B >: A](e: B): Chunk[B] +}
\ No newline at end of file diff --git a/test/pending/pos/t4717.scala b/test/pending/pos/t4717.scala new file mode 100644 index 0000000000..43cf412bc6 --- /dev/null +++ b/test/pending/pos/t4717.scala @@ -0,0 +1,7 @@ +trait Bug1[@specialized +A] extends TraversableOnce[A] { + def ++[B >: A](that: TraversableOnce[B]): Iterator[B] = new Iterator[B] { + lazy val it = that.toIterator + def hasNext = it.hasNext + def next = it.next + } +}
\ No newline at end of file diff --git a/test/pending/pos/t4787.scala b/test/pending/pos/t4787.scala new file mode 100644 index 0000000000..cf3fe93c50 --- /dev/null +++ b/test/pending/pos/t4787.scala @@ -0,0 +1,4 @@ +trait MatrixImpl[@specialized A, @specialized B] { + def mapTo[ A2, B2, That <: MatrixImpl[A2, B2]](that: That)(f: A => A2) { + } +} |