From aa6723c500b5c226a68609418f98f94adab7a8bf Mon Sep 17 00:00:00 2001 From: Eugene Vigdorchik Date: Sun, 7 Apr 2013 14:07:05 +0400 Subject: 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 --- test/files/pos/t7329.scala | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/files/pos/t7329.scala (limited to 'test') 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 -- cgit v1.2.3