Skip to content

Commit 61ae7dc

Browse files
committed
Add partial fix to anonymous application of FunctionX
This will fail on tree-checks because we're not assigning a type to the created val.
1 parent 75f4400 commit 61ae7dc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,12 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
573573
else
574574
new ApplyToUntyped(tree, fun1, funRef, proto, pt)(argCtx(tree))
575575
convertNewGenericArray(ConstFold(app.result))
576+
case mt: MethodType =>
577+
val applyVal = untpd.ValDef(ctx.freshName("applyVal").toTermName, untpd.TypeTree(), tree.fun)
578+
val valBlock =
579+
untpd.Block(applyVal :: Nil, untpd.Apply(untpd.Ident(applyVal.name), tree.args))
580+
581+
typed(valBlock, pt)
576582
case _ =>
577583
handleUnexpectedFunType(tree, fun1)
578584
}

0 commit comments

Comments
 (0)