From bcd1e4f3a3c7a683bb7cf435ef8163ecaf90f126 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Tue, 30 Sep 2014 14:50:30 +1000 Subject: SI-8868 Fix unpickling of local dummy symbols These pop up as the owner of symbols in annotation arguments, such as the ones introduced by the names/defaults desugaring. The first two test cases here motivate the two patches to Unpicker. The third requires both fixes, but exploits the problem directly, without using `@deprecated` and named arguments. See also 14fa7be / SI-8708 for a recently remedied kindred bug. --- test/files/pos/t8868a/Sub_2.scala | 1 + test/files/pos/t8868a/T_1.scala | 6 ++++++ test/files/pos/t8868b/Sub_2.scala | 2 ++ test/files/pos/t8868b/T_1.scala | 4 ++++ test/files/pos/t8868c/Sub_2.scala | 2 ++ test/files/pos/t8868c/T_1.scala | 9 +++++++++ 6 files changed, 24 insertions(+) create mode 100644 test/files/pos/t8868a/Sub_2.scala create mode 100644 test/files/pos/t8868a/T_1.scala create mode 100644 test/files/pos/t8868b/Sub_2.scala create mode 100644 test/files/pos/t8868b/T_1.scala create mode 100644 test/files/pos/t8868c/Sub_2.scala create mode 100644 test/files/pos/t8868c/T_1.scala (limited to 'test') diff --git a/test/files/pos/t8868a/Sub_2.scala b/test/files/pos/t8868a/Sub_2.scala new file mode 100644 index 0000000000..a19b529c88 --- /dev/null +++ b/test/files/pos/t8868a/Sub_2.scala @@ -0,0 +1 @@ +class Sub extends T diff --git a/test/files/pos/t8868a/T_1.scala b/test/files/pos/t8868a/T_1.scala new file mode 100644 index 0000000000..9fb97b1413 --- /dev/null +++ b/test/files/pos/t8868a/T_1.scala @@ -0,0 +1,6 @@ +class C + +trait T { + @deprecated(since = "", message = "") + class X +} diff --git a/test/files/pos/t8868b/Sub_2.scala b/test/files/pos/t8868b/Sub_2.scala new file mode 100644 index 0000000000..58b44db2b3 --- /dev/null +++ b/test/files/pos/t8868b/Sub_2.scala @@ -0,0 +1,2 @@ +class Sub extends T + diff --git a/test/files/pos/t8868b/T_1.scala b/test/files/pos/t8868b/T_1.scala new file mode 100644 index 0000000000..0b71cfdaa3 --- /dev/null +++ b/test/files/pos/t8868b/T_1.scala @@ -0,0 +1,4 @@ +@deprecated(since = "2.4.0", message = "") +trait T { + class X +} diff --git a/test/files/pos/t8868c/Sub_2.scala b/test/files/pos/t8868c/Sub_2.scala new file mode 100644 index 0000000000..58b44db2b3 --- /dev/null +++ b/test/files/pos/t8868c/Sub_2.scala @@ -0,0 +1,2 @@ +class Sub extends T + diff --git a/test/files/pos/t8868c/T_1.scala b/test/files/pos/t8868c/T_1.scala new file mode 100644 index 0000000000..dc541950d8 --- /dev/null +++ b/test/files/pos/t8868c/T_1.scala @@ -0,0 +1,9 @@ +class C(a: Any) extends annotation.StaticAnnotation + +@C({val x = 0; x}) +trait T { + class X + + @C({val x = 0; x}) + def foo = 42 +} -- cgit v1.2.3