diff options
author | odersky <odersky@gmail.com> | 2014-03-16 13:07:10 +0100 |
---|---|---|
committer | odersky <odersky@gmail.com> | 2014-03-16 13:07:10 +0100 |
commit | 027abb4de0710b17ba92499f231d0b0d6467831a (patch) | |
tree | 7323ef4304c67037165b8f55277f603b63897916 /tests/pos | |
parent | 6a97264962f9e50565a18ba68669c32ca29e90f4 (diff) | |
parent | 1554fddc964e71285b0c3860ec3834557fdd2cd4 (diff) | |
download | dotty-027abb4de0710b17ba92499f231d0b0d6467831a.tar.gz dotty-027abb4de0710b17ba92499f231d0b0d6467831a.tar.bz2 dotty-027abb4de0710b17ba92499f231d0b0d6467831a.zip |
Merge pull request #69 from odersky/topic/generalize-companions
Bullet-proofing companion objects
Diffstat (limited to 'tests/pos')
-rw-r--r-- | tests/pos/companions.scala | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/pos/companions.scala b/tests/pos/companions.scala new file mode 100644 index 000000000..6821ad768 --- /dev/null +++ b/tests/pos/companions.scala @@ -0,0 +1,28 @@ +object companions { + + def foo() = { + + class C { + println(C.p) + private val q = 2 + } + + object C { + private val p = 1 + println(new C().q) + } + } + +} +object companions2 { + def foo() = { + { + class C { + println(C.p) + } + object C { + private val p = 1 + } + } + } +} |