aboutsummaryrefslogtreecommitdiff
path: root/tests/run
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-02-19 21:58:50 +0100
committerMartin Odersky <odersky@gmail.com>2017-02-19 21:59:01 +0100
commitbd80a187c3792a4891bec72e0b27b858a5a992ab (patch)
treeb031c9ecf7f29d23375067eee82cf473eaef9cca /tests/run
parentc54e942ef6275fc0c61c051539a1b37f4e12123c (diff)
downloaddotty-bd80a187c3792a4891bec72e0b27b858a5a992ab.tar.gz
dotty-bd80a187c3792a4891bec72e0b27b858a5a992ab.tar.bz2
dotty-bd80a187c3792a4891bec72e0b27b858a5a992ab.zip
Harden outer proxy computation of inlined code
It turns out that we simply cannot do reliable outer path computation that fills in the right hand sides of this-proxies from the types of these proxies. As-seen-from logic can mangle the types of proxies enough to scramble the necessary information. What we now do instead is simply count: We record the number of outer accesses to an outer this in inlineable code, and do the same number of outer accesses when computing the proxy.
Diffstat (limited to 'tests/run')
-rw-r--r--tests/run/i1990b.check1
-rw-r--r--tests/run/i1990b.scala20
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/run/i1990b.check b/tests/run/i1990b.check
new file mode 100644
index 000000000..dd84bc9fb
--- /dev/null
+++ b/tests/run/i1990b.check
@@ -0,0 +1 @@
+C()
diff --git a/tests/run/i1990b.scala b/tests/run/i1990b.scala
new file mode 100644
index 000000000..2460208db
--- /dev/null
+++ b/tests/run/i1990b.scala
@@ -0,0 +1,20 @@
+trait A { self =>
+ class Foo {
+ inline def inlineMeth: Unit = {
+ println(self)
+ }
+ }
+}
+
+case class A2() extends A {
+ case class C() extends Foo with A
+
+ val c = new C
+ (new c.Foo).inlineMeth
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ new A2
+ }
+}