From f8fbd5dbf031a04343c795cfa99cf768add65f05 Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Tue, 16 Jun 2015 17:00:25 -0700 Subject: SI-9356 more careful assertion in back-end Calling `exists` on a `Symbol` triggers unpickling, which failed for reasons I did not investigate. Replaced `sym.exists` by `sym != NoSymbol`, which is good enough here. Also replaced assertion by a `devWarning`, since the logic seems too ad-hoc to actually crash the compiler when it's invalidated. Partially reverts b45a91fe22. See also #1532. --- test/files/pos/t9356/Foo_2.scala | 6 ++++++ test/files/pos/t9356/MyAnnotation.java | 12 ++++++++++++ test/files/pos/t9356/Test_3.scala | 3 +++ 3 files changed, 21 insertions(+) create mode 100644 test/files/pos/t9356/Foo_2.scala create mode 100644 test/files/pos/t9356/MyAnnotation.java create mode 100644 test/files/pos/t9356/Test_3.scala (limited to 'test') diff --git a/test/files/pos/t9356/Foo_2.scala b/test/files/pos/t9356/Foo_2.scala new file mode 100644 index 0000000000..ab7bb44d0e --- /dev/null +++ b/test/files/pos/t9356/Foo_2.scala @@ -0,0 +1,6 @@ +class C + +trait Foo { + @annot.MyAnnotation(cls = classOf[C]) + def function: Any = ??? +} diff --git a/test/files/pos/t9356/MyAnnotation.java b/test/files/pos/t9356/MyAnnotation.java new file mode 100644 index 0000000000..b6c00e7356 --- /dev/null +++ b/test/files/pos/t9356/MyAnnotation.java @@ -0,0 +1,12 @@ +package annot; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface MyAnnotation { + Class cls(); +} diff --git a/test/files/pos/t9356/Test_3.scala b/test/files/pos/t9356/Test_3.scala new file mode 100644 index 0000000000..fa1b76c9e1 --- /dev/null +++ b/test/files/pos/t9356/Test_3.scala @@ -0,0 +1,3 @@ +class Foo1 extends Foo + +class Foo2 extends Foo \ No newline at end of file -- cgit v1.2.3