diff options
Diffstat (limited to 'test/files/run/t8196.scala')
-rw-r--r-- | test/files/run/t8196.scala | 30 |
1 files changed, 30 insertions, 0 deletions
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() +} |