summaryrefslogtreecommitdiff
path: root/test/files/run/t5423.scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-01-31 11:30:41 +0100
committerEugene Burmako <xeno.by@gmail.com>2012-01-31 11:39:36 +0100
commit2e664079445549288789ad24a95ce7d583ae205c (patch)
tree166e7ff1e412a151f0d16f734e6c4e3c40f93ba3 /test/files/run/t5423.scala
parent263aa2ead1f599f48b218027eb9550745fef43f1 (diff)
downloadscala-2e664079445549288789ad24a95ce7d583ae205c.tar.gz
scala-2e664079445549288789ad24a95ce7d583ae205c.tar.bz2
scala-2e664079445549288789ad24a95ce7d583ae205c.zip
Introduce getAnnotations that triggers symbol completion
Default getter for annotations doesn't perform initialization, hence we've faced the following bug: https://issues.scala-lang.org/browse/SI-5423. One of the approaches to fixing it would be to auto-complete on getter, but according to Martin we'd better not do that because of cycles. That's why I'm just introducing a new, eager, variation of `annotations' and redirecting public API to it. Review by @odersky.
Diffstat (limited to 'test/files/run/t5423.scala')
-rw-r--r--test/files/run/t5423.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/files/run/t5423.scala b/test/files/run/t5423.scala
new file mode 100644
index 0000000000..2139773ff1
--- /dev/null
+++ b/test/files/run/t5423.scala
@@ -0,0 +1,12 @@
+import java.lang.Class
+import scala.reflect.mirror._
+import scala.reflect.runtime.Mirror.ToolBox
+import scala.reflect.Code
+
+final class table extends StaticAnnotation
+@table class A
+
+object Test extends App{
+ val s = classToSymbol(classOf[A])
+ println(s.getAnnotations)
+}