summaryrefslogtreecommitdiff
path: root/test/files/run/t4859.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-12-15 14:22:14 +0100
committerJason Zaugg <jzaugg@gmail.com>2013-01-26 15:41:07 +0100
commitf21b1ce7fda9022d6d805a708882c5a2ab241f41 (patch)
tree8b8de4a28a0dcc6e4118e2986708074c55a42055 /test/files/run/t4859.scala
parenteb4b06544a4362231357686c39beef9dbe00d932 (diff)
downloadscala-f21b1ce7fda9022d6d805a708882c5a2ab241f41.tar.gz
scala-f21b1ce7fda9022d6d805a708882c5a2ab241f41.tar.bz2
scala-f21b1ce7fda9022d6d805a708882c5a2ab241f41.zip
SI-4859 Don't elide qualifiers when selecting nested modules.
Otherwise we fail to throw in: {???; Predef}.DummyImplicit.dummyImplicit We still elide the initialization of `Outer` in `Outer.Inner.foo` as before, although that seems a little dubious to me. In total, we had to change RefChecks, Flatten, and GenICode to effect this change. A recently fixed bug in tail call elimination was also due to assuming that the the qualifier of a Select node wasn't worthy of traversal. Let's keep a close eye out for more instances of this problem.
Diffstat (limited to 'test/files/run/t4859.scala')
-rw-r--r--test/files/run/t4859.scala29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/files/run/t4859.scala b/test/files/run/t4859.scala
new file mode 100644
index 0000000000..6d223f2179
--- /dev/null
+++ b/test/files/run/t4859.scala
@@ -0,0 +1,29 @@
+object O {
+ case class N()
+ object P
+}
+
+object Outer {
+ println("Outer")
+ object Inner {
+ println("Inner")
+ def i {
+ println("Inner.i")
+ }
+ }
+}
+
+object Test {
+ def main(args: Array[String]) {
+ Outer.Inner.i // we still don't initiialize Outer here (but should we?)
+
+ {println("About to reference Inner.i"); Outer}.Inner.i // Outer will be initialized.
+
+ {println("About to reference O.N" ); O}.N
+
+ {println("About to reference O.N" ); O}.N
+
+ {println("About to reference O.N.apply()"); O}.N.apply()
+ }
+}
+