diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-01-31 11:30:41 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-01-31 11:39:36 +0100 |
commit | 2e664079445549288789ad24a95ce7d583ae205c (patch) | |
tree | 166e7ff1e412a151f0d16f734e6c4e3c40f93ba3 /test/files/run | |
parent | 263aa2ead1f599f48b218027eb9550745fef43f1 (diff) | |
download | scala-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')
-rw-r--r-- | test/files/run/t5423.check | 1 | ||||
-rw-r--r-- | test/files/run/t5423.scala | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/test/files/run/t5423.check b/test/files/run/t5423.check new file mode 100644 index 0000000000..ae3d3fb82b --- /dev/null +++ b/test/files/run/t5423.check @@ -0,0 +1 @@ +List(table)
\ No newline at end of file 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) +} |