diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t8196.check | 3 | ||||
-rw-r--r-- | test/files/run/t8196.scala | 30 |
2 files changed, 33 insertions, 0 deletions
diff --git a/test/files/run/t8196.check b/test/files/run/t8196.check new file mode 100644 index 0000000000..3286c15c91 --- /dev/null +++ b/test/files/run/t8196.check @@ -0,0 +1,3 @@ +Scope{ + final private val f1: Int +} diff --git a/test/files/run/t8196.scala b/test/files/run/t8196.scala new file mode 100644 index 0000000000..d526eafbb3 --- /dev/null +++ b/test/files/run/t8196.scala @@ -0,0 +1,30 @@ +object Test extends App { + + trait FormTrait { + import scala.reflect.runtime.{ universe => ru } + + val runtimeMirror = ru.runtimeMirror(this.getClass.getClassLoader) + val instanceMirror = runtimeMirror.reflect(this) + val members = instanceMirror.symbol.typeSignature.members + def fields = members.filter(_.typeSignature <:< ru.typeOf[Int]) + } + + val f = () => { + + class Form1 extends FormTrait { + val f1 = 5 + } + val form1 = new Form1 + + println(form1.fields) + + val form2 = new FormTrait { + val g1 = new Form1 + } + + form2.g1 // comment this line in order to make the test pass + () + } + + f() +} |