Skip to content

Commit 30fa1ad

Browse files
committed
Fix #7863: Handle type lambda trees in inlined code
1 parent 58575f9 commit 30fa1ad

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Inliner.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,9 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
439439
paramProxy(param.typeRef) = adaptToPrefix(param.typeRef)
440440
case tpe: NamedType
441441
if tpe.symbol.is(Param) && tpe.symbol.owner == inlinedMethod && !paramProxy.contains(tpe) =>
442-
paramProxy(tpe) = paramBinding(tpe.name)
442+
paramBinding.get(tpe.name) match
443+
case Some(bound) => paramProxy(tpe) = bound
444+
case _ => // can happen for params bound by type-lambda trees.
443445
case _ =>
444446
}
445447

tests/pos/i7863.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def f[F[_]] = ()
2+
3+
inline def g = f[[R] =>> Int => R]
4+
5+
val a = g

0 commit comments

Comments
 (0)