diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-06-07 22:40:41 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-06-08 15:34:40 +0200 |
commit | 0c153ee15e714e0ca8752151012b8f1fa9642983 (patch) | |
tree | 73fbeaee63acc64f08eeaec05da586ded9fa692f /test/files/run/reflection-fieldmirror-nmelocalsuffixstring.scala | |
parent | 178069e13d841c029bd3cf78773788ad3743e218 (diff) | |
download | scala-0c153ee15e714e0ca8752151012b8f1fa9642983.tar.gz scala-0c153ee15e714e0ca8752151012b8f1fa9642983.tar.bz2 scala-0c153ee15e714e0ca8752151012b8f1fa9642983.zip |
fixes some issues with reflectField brought up today
Diffstat (limited to 'test/files/run/reflection-fieldmirror-nmelocalsuffixstring.scala')
-rw-r--r-- | test/files/run/reflection-fieldmirror-nmelocalsuffixstring.scala | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/files/run/reflection-fieldmirror-nmelocalsuffixstring.scala b/test/files/run/reflection-fieldmirror-nmelocalsuffixstring.scala new file mode 100644 index 0000000000..9dca7b452c --- /dev/null +++ b/test/files/run/reflection-fieldmirror-nmelocalsuffixstring.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends App { + class A { + var x: Int = 42 + } + + val a = new A + + val im: InstanceMirror = cm.reflect(a) + val cs = im.reflectClass.symbol + val f = cs.typeSignature.declaration(newTermName("x" + nme.LOCAL_SUFFIX_STRING)).asTermSymbol + val fm: FieldMirror = im.reflectField(f) + println(fm.field.isVariable) +} |