Skip to content

Fix #7863: Handle type lambda trees in inlined code #7922

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 1 commit into from
Jan 8, 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
4 changes: 3 additions & 1 deletion compiler/src/dotty/tools/dotc/typer/Inliner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,9 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
paramProxy(param.typeRef) = adaptToPrefix(param.typeRef)
case tpe: NamedType
if tpe.symbol.is(Param) && tpe.symbol.owner == inlinedMethod && !paramProxy.contains(tpe) =>
paramProxy(tpe) = paramBinding(tpe.name)
paramBinding.get(tpe.name) match
case Some(bound) => paramProxy(tpe) = bound
case _ => // can happen for params bound by type-lambda trees.
case _ =>
}

Expand Down
5 changes: 5 additions & 0 deletions tests/pos/i7863.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def f[F[_]] = ()

inline def g = f[[R] =>> Int => R]

val a = g