Skip to content

Commit 39b8338

Browse files
authored
Merge pull request #6305 from dotty-staging/fix-5259
Fix #5295: handle inline accessor in shortcut implicits
2 parents 4c0ec77 + 3048f4b commit 39b8338

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ 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 =>
133+
val SAMType(mt) = id.tpe.widen
134+
splitClosure(tpd.Lambda(mt, args => id.select(nme.apply).appliedToArgs(args))(ctx.withOwner(original)))
132135
case EmptyTree =>
133136
(_ => _ => EmptyTree, EmptyTree)
134137
}

tests/pos/i5295.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
inline def foo: String = bar given (4)
2+
private def bar: given Int => String = "baz"

0 commit comments

Comments
 (0)