Skip to content

Fix: Weird Case Class Compiler Error with Inline Function #12508 #14476

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

Closed
wants to merge 2 commits into from
Closed
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
7 changes: 2 additions & 5 deletions compiler/src/dotty/tools/dotc/typer/Inliner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,8 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
bindingFlags |= Method
val boundSym = newSym(InlineBinderName.fresh(name.asTermName), bindingFlags, bindingType).asTerm
val binding = {
var newArg = arg.changeOwner(ctx.owner, boundSym)
if bindingFlags.is(Inline) && argIsBottom then
newArg = Typed(newArg, TypeTree(formal)) // type ascribe RHS to avoid type errors in expansion. See i8612.scala
if isByName then DefDef(boundSym, newArg)
else ValDef(boundSym, newArg)
if (isByName) DefDef(boundSym, arg.changeOwner(ctx.owner, boundSym))
else ValDef(boundSym, arg)
}.withSpan(boundSym.span)
inlining.println(i"parameter binding: $binding, $argIsBottom")
buf += binding
Expand Down