diff options
author | Paul Phillips <paulp@improving.org> | 2012-02-14 22:04:30 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-02-14 23:49:28 -0800 |
commit | bb23d766bceccecc99280b543001bc70e16afbc9 (patch) | |
tree | c6c737a25ee99b1910db06f527f0a123d89c6752 /test/files/run | |
parent | 4c48abbe5a438b5c892ee096d816770213c54ef5 (diff) | |
download | scala-bb23d766bceccecc99280b543001bc70e16afbc9.tar.gz scala-bb23d766bceccecc99280b543001bc70e16afbc9.tar.bz2 scala-bb23d766bceccecc99280b543001bc70e16afbc9.zip |
Specialization action.
The crickets at http://www.scala-lang.org/node/11901 were in
unanimous agreement that I should proceed as suggested.
- No arguments to @specialize gets you 10/10, not 9/10
- Fixed bugs in AnyRef specialization revealed by trying to use it
- Specialized Function1 on AnyRef.
- Changed AnyRef specialization to use OBJECT_TAG, not TVAR_TAG.
- Deprecated SpecializableCompanion in favor of Specializable,
which has the virtue of being public so it can be referenced
from outside the library.
- Cooked up mechanism to group specializable types so we don't
have to repeat ourselves quite so much, and create a few groups
for illustrative purposes. I'm not too serious about those names
but I used up all my name-thinking-up brain for the day.
- Updated genprod and friends since I had to regenerate Function1.
- Put tests for a bunch of remaining specialization bugs in pending.
Closes SI-4740, SI-4770, SI-5267.
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t3575.check | 4 | ||||
-rw-r--r-- | test/files/run/t3575.scala | 12 | ||||
-rw-r--r-- | test/files/run/t4770.check | 2 | ||||
-rw-r--r-- | test/files/run/t4770.scala | 15 | ||||
-rw-r--r-- | test/files/run/t4794.check | 2 |
5 files changed, 34 insertions, 1 deletions
diff --git a/test/files/run/t3575.check b/test/files/run/t3575.check new file mode 100644 index 0000000000..c240b3d90c --- /dev/null +++ b/test/files/run/t3575.check @@ -0,0 +1,4 @@ +Two +Two +Two +Two$mcII$sp diff --git a/test/files/run/t3575.scala b/test/files/run/t3575.scala new file mode 100644 index 0000000000..56950e62bb --- /dev/null +++ b/test/files/run/t3575.scala @@ -0,0 +1,12 @@ +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. +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()) + } +} diff --git a/test/files/run/t4770.check b/test/files/run/t4770.check new file mode 100644 index 0000000000..38e5a831fa --- /dev/null +++ b/test/files/run/t4770.check @@ -0,0 +1,2 @@ +(a,2) +(2,a) diff --git a/test/files/run/t4770.scala b/test/files/run/t4770.scala new file mode 100644 index 0000000000..25bf3050c3 --- /dev/null +++ b/test/files/run/t4770.scala @@ -0,0 +1,15 @@ +package crasher { + class Z[@specialized A, @specialized(AnyRef) B](var a: A, var b: B) { + override def toString = "" + ((a, b)) + } + object O { + def apply[@specialized A, @specialized(AnyRef) B](a0: A, b0: B) = new Z(a0, b0) + } +} + +object Test { + def main(args: Array[String]): Unit = { + println(crasher.O("a", 2)) + println(crasher.O(2, "a")) + } +} diff --git a/test/files/run/t4794.check b/test/files/run/t4794.check index f599e28b8a..b4de394767 100644 --- a/test/files/run/t4794.check +++ b/test/files/run/t4794.check @@ -1 +1 @@ -10 +11 |