diff options
author | Paul Phillips <paulp@improving.org> | 2012-11-19 14:50:29 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-11-24 01:34:18 -0800 |
commit | 7f1ba06f1313383fe60ce9bc6566afc78b3dae75 (patch) | |
tree | c31b7c36d1298bcc56c08f9dbd55ed5db97bbcd2 /test/files | |
parent | 5b498a2612f967c944fa1ed4f63a09d6acc41791 (diff) | |
download | scala-7f1ba06f1313383fe60ce9bc6566afc78b3dae75.tar.gz scala-7f1ba06f1313383fe60ce9bc6566afc78b3dae75.tar.bz2 scala-7f1ba06f1313383fe60ce9bc6566afc78b3dae75.zip |
Fix for SI-6687, wrong isVar logic.
Fields which back lazy vals need to be excluded via !isLazy
lest isVar return true.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/t6687.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/files/run/t6687.scala b/test/files/run/t6687.scala new file mode 100644 index 0000000000..ee44e5f0d2 --- /dev/null +++ b/test/files/run/t6687.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ + +class A { lazy val x = 1 } + +object Test { + def main(args: Array[String]): Unit = { + val vars = typeOf[A].members.toList filter (x => x.isTerm && x.asTerm.isVar) + assert(vars.isEmpty, vars) + } +} |