From 87e369ef46bd2ca569ffd1cd6f3a554f1d645dc9 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 19 Feb 2012 00:03:55 -0800 Subject: More specialization tests. Some in pending, some in files. Closes SI-4770. --- test/files/run/t3575.scala | 55 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 49 insertions(+), 6 deletions(-) (limited to 'test/files/run/t3575.scala') 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()); } } -- cgit v1.2.3