Skip to content

Commit 3736816

Browse files
authored
Merge pull request #6596 from dotty-staging/fix-2723
Fix #2723: generate direct method for inline accessors
2 parents 3d64fd5 + cc756c6 commit 3736816

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class ShortcutImplicits extends MiniPhase with IdentityDenotTransformer { thisPh
129129
.appliedToArgss(vparamSymss.map(_.map(ref(_))) :+ clparamSyms.map(ref(_)))
130130
val fwdClosure = cpy.Block(tree)(cpy.DefDef(meth)(rhs = forwarder) :: Nil, cl)
131131
(remappedCore, fwdClosure)
132-
case id: Ident =>
132+
case id: RefTree =>
133133
val SAMType(mt) = id.tpe.widen
134134
splitClosure(tpd.Lambda(mt, args => id.select(nme.apply).appliedToArgs(args))(ctx.withOwner(original)))
135135
case EmptyTree =>

tests/pos/i2723.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
trait App(init: given Array[String] => Unit) {
2+
inline def main(args: Array[String]): Unit = init given args
3+
}

0 commit comments

Comments
 (0)