diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2013-01-31 19:46:51 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2013-01-31 19:46:51 +0100 |
commit | 2403d1ddcaa1bd76c1f376a32ec03a36d4dab48b (patch) | |
tree | 109d952673e43bbd279111b18d5446f5935b9132 /test/files/run | |
parent | 42c4cc7a1eed222a1593c6ac2652cd5357c2897a (diff) | |
download | scala-2403d1ddcaa1bd76c1f376a32ec03a36d4dab48b.tar.gz scala-2403d1ddcaa1bd76c1f376a32ec03a36d4dab48b.tar.bz2 scala-2403d1ddcaa1bd76c1f376a32ec03a36d4dab48b.zip |
SI-7046 reflection now auto-initializes knownDirectSubclasses
knownDirectSubclasses joins the happy family of flags, annotations and
privateWithin, which automatically trigger initialization, when used
within runtime reflection.
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t7046.check | 2 | ||||
-rw-r--r-- | test/files/run/t7046.scala | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/test/files/run/t7046.check b/test/files/run/t7046.check new file mode 100644 index 0000000000..427f1ce610 --- /dev/null +++ b/test/files/run/t7046.check @@ -0,0 +1,2 @@ +Set(class D, class E) +Set(class D, class E) diff --git a/test/files/run/t7046.scala b/test/files/run/t7046.scala new file mode 100644 index 0000000000..647a15cd18 --- /dev/null +++ b/test/files/run/t7046.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +sealed class C +class D extends C +class E extends C + +object Test extends App { + val c = cm.staticClass("C") + println(c.knownDirectSubclasses) + c.typeSignature + println(c.knownDirectSubclasses) +}
\ No newline at end of file |