From 2403d1ddcaa1bd76c1f376a32ec03a36d4dab48b Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Thu, 31 Jan 2013 19:46:51 +0100 Subject: 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. --- test/files/run/t7046.check | 2 ++ test/files/run/t7046.scala | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 test/files/run/t7046.check create mode 100644 test/files/run/t7046.scala (limited to 'test/files/run') 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 -- cgit v1.2.3