summaryrefslogtreecommitdiff
path: root/test/files/neg/t7046/Test_2.scala
diff options
context:
space:
mode:
authorMiles Sabin <miles@milessabin.com>2016-08-10 09:30:49 +0100
committerMiles Sabin <miles@milessabin.com>2016-08-15 18:32:45 +0100
commitd171b2cc16cc129e0f3aa03c3df9b2fb86208aa6 (patch)
treed95c542dddf2ae9e8c12843cd1b6478a7e5ad2c6 /test/files/neg/t7046/Test_2.scala
parent81a67eeacc7d2622ee364a21203b227142e2043e (diff)
downloadscala-d171b2cc16cc129e0f3aa03c3df9b2fb86208aa6.tar.gz
scala-d171b2cc16cc129e0f3aa03c3df9b2fb86208aa6.tar.bz2
scala-d171b2cc16cc129e0f3aa03c3df9b2fb86208aa6.zip
Partial fix for SI-7046
Diffstat (limited to 'test/files/neg/t7046/Test_2.scala')
-rw-r--r--test/files/neg/t7046/Test_2.scala35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/files/neg/t7046/Test_2.scala b/test/files/neg/t7046/Test_2.scala
new file mode 100644
index 0000000000..fcb3e46a0f
--- /dev/null
+++ b/test/files/neg/t7046/Test_2.scala
@@ -0,0 +1,35 @@
+object Test extends App {
+ val subs = Macros.knownDirectSubclasses[Foo]
+ assert(subs == List("Wibble", "Wobble", "Bar", "Baz"))
+}
+
+sealed trait Foo
+object Foo {
+ trait Wibble extends Foo
+ case object Wobble extends Foo
+}
+
+trait Bar extends Foo
+
+object Blah {
+ type Quux = Foo
+}
+
+import Blah._
+
+trait Baz extends Quux
+
+class Boz[T](t: T)
+class Unrelated extends Boz(Test.subs)
+
+object Enigma {
+ locally {
+ // local class not seen
+ class Local extends Foo
+ }
+
+ def foo: Unit = {
+ // local class not seen
+ class Riddle extends Foo
+ }
+}