summaryrefslogtreecommitdiff
path: root/test/files/neg/t6276.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-09-11 22:03:58 +0200
committerJason Zaugg <jzaugg@gmail.com>2012-09-11 22:39:50 +0200
commit1776337253744482b7116326413de5e260a5984e (patch)
treef55b336022b6f0ba4a83e5332d247bb9071c48e0 /test/files/neg/t6276.scala
parentea651e6fe187920d207aa5fe3c645d294e72e627 (diff)
downloadscala-1776337253744482b7116326413de5e260a5984e.tar.gz
scala-1776337253744482b7116326413de5e260a5984e.tar.bz2
scala-1776337253744482b7116326413de5e260a5984e.zip
Avoid spurious warning for `def foo = x.foo`.
Followup to SI-6276.
Diffstat (limited to 'test/files/neg/t6276.scala')
-rw-r--r--test/files/neg/t6276.scala17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/files/neg/t6276.scala b/test/files/neg/t6276.scala
index 8333618964..bd0a473f71 100644
--- a/test/files/neg/t6276.scala
+++ b/test/files/neg/t6276.scala
@@ -1,8 +1,11 @@
object Test {
def foo(a: Int, b: Int, c: Int) {
- new {
+ class C {
def a: Any = a // warn
val b: Any = b // warn
+
+ def c: Any = this.c // warn
+ def d: Any = C.this.d // warn
}
def method {
@@ -25,5 +28,17 @@ object Test {
val b: Any = {println(""); b}
def c(i: Int): Any = c(i - 0)
}
+
+ class D {
+ def other: D = null
+ def foo: Any = other.foo
+ }
+
+ class E {
+ def foo: Any = 0
+ class D extends E {
+ override def foo: Any = E.this.foo
+ }
+ }
}
}