Skip to content

Commit 5d354f3

Browse files
authored
Merge pull request #8046 from dotty-staging/fix-#8035
Fix #8035: Add missing transformFollowing to VCInlineMethods
2 parents 54ab00e + 9928fd4 commit 5d354f3

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

compiler/src/dotty/tools/dotc/transform/VCInlineMethods.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
package dotty.tools.dotc
1+
package dotty.tools
2+
package dotc
23
package transform
34

45
import ast.{Trees, tpd}
@@ -71,10 +72,11 @@ class VCInlineMethods extends MiniPhase with IdentityDenotTransformer {
7172
evalOnce(qual) { ev =>
7273
val ctArgs = ctParams.map(tparam =>
7374
TypeTree(tparam.typeRef.asSeenFrom(ev.tpe, origCls)))
74-
ref(extensionMeth)
75+
transformFollowing(
76+
ref(extensionMeth)
7577
.appliedToTypeTrees(mtArgs ++ ctArgs)
7678
.appliedTo(ev)
77-
.appliedToArgss(mArgss)
79+
.appliedToArgss(mArgss))
7880
}
7981
else
8082
ref(extensionMeth)

tests/run/i8035.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
implicit class Ops[A](val a: String) extends AnyVal {
2+
def foo(e: => String): Unit = ()
3+
}
4+
5+
def bar(e1: => String): Unit = (new Ops("")).foo(e1)
6+
def baz(e2: => String): Unit = "".foo(e2)
7+
8+
@main def Test = baz("")

0 commit comments

Comments
 (0)