summaryrefslogtreecommitdiff
path: root/test/files/run/t4560b.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-07-24 16:54:07 -0700
committerPaul Phillips <paulp@improving.org>2012-07-24 20:45:01 -0700
commit6eb55d4b7ab804ba581157ed39df42ded885a12e (patch)
tree73e2c32c11695ea5e222a8f378261f1cdcd0e617 /test/files/run/t4560b.scala
parent392438b77ea4961c919e3115055336ce6fca85af (diff)
downloadscala-6eb55d4b7ab804ba581157ed39df42ded885a12e.tar.gz
scala-6eb55d4b7ab804ba581157ed39df42ded885a12e.tar.bz2
scala-6eb55d4b7ab804ba581157ed39df42ded885a12e.zip
Fix SI-4560, NoSuchMethodErrors involving self types.
Following this commit are reversions of three prior commits which introduced difficulties of their own, plus extra tests for this issue and SI-4601, all of which I pinched from jrudolph. Maybe there was a good reason for some of the complicated code related to this ticket. I took the naive position that if we avoided generating a method call to a particular receiver if the receiver has no such method, we would encounter fewer NoSuchMethodErrors. I would believe one can construct a scenario which this doesn't handle correctly, but it's hard to believe this isn't a big improvement. Review by @jrudolph, @odersky.
Diffstat (limited to 'test/files/run/t4560b.scala')
-rw-r--r--test/files/run/t4560b.scala28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/files/run/t4560b.scala b/test/files/run/t4560b.scala
new file mode 100644
index 0000000000..97fe00ce37
--- /dev/null
+++ b/test/files/run/t4560b.scala
@@ -0,0 +1,28 @@
+object Outer {
+ class Tester
+ private[Outer] trait B4 { _: Tester =>
+ protected val FREQ = 23
+ def fail() = {
+ println(FREQ)
+ }
+ }
+ object C4 extends Tester with B4
+}
+
+object Outer2 {
+ abstract class A5
+ private[Outer2] trait C5 {
+ def impl() { println("SUCCESS") }
+ }
+ trait B5 extends C5 { self: A5 =>
+ def fail() { impl() }
+ }
+ object Test5 extends A5 with B5 with C5
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ Outer.C4.fail()
+ Outer2.Test5.fail()
+ }
+}