diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2016-09-27 16:58:25 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2016-09-29 11:49:36 -0700 |
commit | 493e22f321d6e7774e74419242b6e3d61eff6bad (patch) | |
tree | 5f7ae7fcf7563213a98a6aeb7d43f80ff55796f3 /test/files/run/local_obj.scala | |
parent | d04cda14d722ff365b4c3b543de008d93772410b (diff) | |
download | scala-493e22f321d6e7774e74419242b6e3d61eff6bad.tar.gz scala-493e22f321d6e7774e74419242b6e3d61eff6bad.tar.bz2 scala-493e22f321d6e7774e74419242b6e3d61eff6bad.zip |
Emit local module like lazy val
The motivation is to use the new fine-grained lock scoping that
local lazies have since #5294.
Fixes scala/scala-dev#235
Co-Authored-By: Jason Zaugg <jzaugg@gmail.com>
Diffstat (limited to 'test/files/run/local_obj.scala')
-rw-r--r-- | test/files/run/local_obj.scala | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/files/run/local_obj.scala b/test/files/run/local_obj.scala new file mode 100644 index 0000000000..25123f7078 --- /dev/null +++ b/test/files/run/local_obj.scala @@ -0,0 +1,9 @@ +class C { + val z = 2 + def mod = { object x { val y = z } ; x.y } +} + +object Test extends App { + val c = new C + assert(c.mod == c.z, s"${c.mod} != ${c.z}") +} |