diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2016-11-30 14:44:35 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-30 14:44:35 +1000 |
commit | d0da258116109272e5f76ea1722af5458bd588e3 (patch) | |
tree | 52f954103f891b0bcaf58f5503ba45f6a9148d89 /test | |
parent | 50d46c12766228155a6d52cf7b33add4fa24a86e (diff) | |
parent | de25e861249826658663a6d40f13b9b91d1146fc (diff) | |
download | scala-d0da258116109272e5f76ea1722af5458bd588e3.tar.gz scala-d0da258116109272e5f76ea1722af5458bd588e3.tar.bz2 scala-d0da258116109272e5f76ea1722af5458bd588e3.zip |
Merge pull request #5563 from lrytz/sd259b
Don't exclude super calls to trait methods from inlining
Diffstat (limited to 'test')
-rw-r--r-- | test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala b/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala index 90a938be35..7be88816d5 100644 --- a/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala +++ b/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala @@ -1738,4 +1738,19 @@ class InlinerTest extends BytecodeTesting { val List(a, c, t) = compile(code, allowMessage = _.msg contains warn) assertInvoke(getMethod(c, "t"), "T", "m$") } + + @Test + def sd259d(): Unit = { + val code = + """trait T { + | @inline final def m = 1 + |} + |class C extends T { + | def t = super.m // inline call to T.m$ here, we're not in the mixin forwarder C.m + |} + """.stripMargin + val List(c, t) = compileClasses(code) + assertNoInvoke(getMethod(c, "t")) + assertInvoke(getMethod(c, "m"), "T", "m$") + } } |