aboutsummaryrefslogtreecommitdiff
path: root/tests/run/i659.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-06-19 15:35:38 +0200
committerMartin Odersky <odersky@gmail.com>2015-06-19 15:35:38 +0200
commitbbc584f0ac3586ce4e4a92e58f74ad69a15f0ed5 (patch)
treeb02ec85a4290b94a1d92fd728af83f2e71357950 /tests/run/i659.scala
parent1b31f068a1a01619ba2ee2635d5f3c90162bf1d1 (diff)
downloaddotty-bbc584f0ac3586ce4e4a92e58f74ad69a15f0ed5.tar.gz
dotty-bbc584f0ac3586ce4e4a92e58f74ad69a15f0ed5.tar.bz2
dotty-bbc584f0ac3586ce4e4a92e58f74ad69a15f0ed5.zip
Fix problem with explicit outer accessors
Even if an explicit outer accessor was a method, it got a TermRef as type.
Diffstat (limited to 'tests/run/i659.scala')
-rw-r--r--tests/run/i659.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/run/i659.scala b/tests/run/i659.scala
new file mode 100644
index 000000000..5f10f15e8
--- /dev/null
+++ b/tests/run/i659.scala
@@ -0,0 +1,12 @@
+class Foo(val a: Int) {
+ //def foo = { {case x => x + a}: PartialFunction[Int, Int]}
+ class Bar { def result(x: Int) = x + a }
+ def bar = new Bar
+}
+
+object Test extends dotty.runtime.LegacyApp {
+ //val x = new Foo(1).foo.apply(2)
+ val y = new Foo(1).bar.result(2)
+ assert(y == 3, y)
+ //assert(x == 3, x)
+}