aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/t3174.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-06-07 16:45:50 +0200
committerMartin Odersky <odersky@gmail.com>2015-06-07 16:46:05 +0200
commitce1780fbcbafd7be298f930a611743386aa0d6a6 (patch)
tree7a4c21d33746a2f5f3f993dbe7d02382b276324b /tests/pos/t3174.scala
parent6ca52b0f23f0c3425d054d0918a149e0e7afb765 (diff)
downloaddotty-ce1780fbcbafd7be298f930a611743386aa0d6a6.tar.gz
dotty-ce1780fbcbafd7be298f930a611743386aa0d6a6.tar.bz2
dotty-ce1780fbcbafd7be298f930a611743386aa0d6a6.zip
Fix refs to inner objects
A reference to an object from anywhere in its module class can be established by the This of the module class. The previous behavior always referenced the object as a term ref which might cause a reference to the outer This which might not be available (since this is not tracked by ExplicitOuter). Brings t3174.scala back from disabled.
Diffstat (limited to 'tests/pos/t3174.scala')
-rw-r--r--tests/pos/t3174.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/pos/t3174.scala b/tests/pos/t3174.scala
new file mode 100644
index 000000000..bae941bc1
--- /dev/null
+++ b/tests/pos/t3174.scala
@@ -0,0 +1,16 @@
+object test {
+ def method(): Unit = {
+ class Foo extends AnyRef {
+ object Color {
+ object Blue {
+ //val b = new Board
+ }
+ }
+
+ class Board {
+ val grid = Color.Blue
+ }
+ }
+ new Foo
+ }
+ }