Skip to content

Fix #8035: Add missing transformFollowing to VCInlineMethods #8046

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions compiler/src/dotty/tools/dotc/transform/VCInlineMethods.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package dotty.tools.dotc
package dotty.tools
package dotc
package transform

import ast.{Trees, tpd}
Expand Down Expand Up @@ -71,10 +72,11 @@ class VCInlineMethods extends MiniPhase with IdentityDenotTransformer {
evalOnce(qual) { ev =>
val ctArgs = ctParams.map(tparam =>
TypeTree(tparam.typeRef.asSeenFrom(ev.tpe, origCls)))
ref(extensionMeth)
transformFollowing(
ref(extensionMeth)
.appliedToTypeTrees(mtArgs ++ ctArgs)
.appliedTo(ev)
.appliedToArgss(mArgss)
.appliedToArgss(mArgss))
}
else
ref(extensionMeth)
Expand Down
8 changes: 8 additions & 0 deletions tests/run/i8035.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
implicit class Ops[A](val a: String) extends AnyVal {
def foo(e: => String): Unit = ()
}

def bar(e1: => String): Unit = (new Ops("")).foo(e1)
def baz(e2: => String): Unit = "".foo(e2)

@main def Test = baz("")