summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEugene Vigdorchik <eugene.vigdorchik@gmail.com>2013-04-07 14:07:05 +0400
committerEugene Vigdorchik <eugene.vigdorchik@gmail.com>2013-04-07 17:26:36 +0400
commitaa6723c500b5c226a68609418f98f94adab7a8bf (patch)
tree7d33d49e6ac3ab2efa291b431a0385f9ac4393b3 /test
parent58ae1cacdb5fd65bbf876cc6a8d1d1de09e3ce68 (diff)
downloadscala-aa6723c500b5c226a68609418f98f94adab7a8bf.tar.gz
scala-aa6723c500b5c226a68609418f98f94adab7a8bf.tar.bz2
scala-aa6723c500b5c226a68609418f98f94adab7a8bf.zip
SI-7329 duplicate default getters for specialized parameters.
The default getter is generated with @specialized annotation if the type parameter corresponding to the type of the parameter is specialized. Consequently specialize pass tries to generate overloads. Rather than pruning overloads to exclude duplicates, let's notice that default getter specialization is not needed at all: - The dynamic scope of default getter doesn't include specialized method or class constructor. - generic default getter is called even when calling specialized method: object V { @specialized def foo[@specialized B](b: B = (??? : B)) = {} foo[Int]() } gives: invokevirtual Method V$.foo$default$1:()Ljava/lang/Object; invokestatic (unboxToInt) invokevirtual Method V$.foo$mIc$sp:(I)V
Diffstat (limited to 'test')
-rw-r--r--test/files/pos/t7329.scala1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/files/pos/t7329.scala b/test/files/pos/t7329.scala
new file mode 100644
index 0000000000..76bf1fb9f5
--- /dev/null
+++ b/test/files/pos/t7329.scala
@@ -0,0 +1 @@
+class TwoParamSpecializedWithDefault[@specialized A, @specialized B](a: A, b: B = (??? : B)) \ No newline at end of file