Skip to content

Commit d3adfd7

Browse files
committed
Fix Nullarify treating all 'apply' methods as Function0
1 parent 0aa3f4c commit d3adfd7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotty/tools/dotc/transform/Nullarify.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Nullarify extends TreeTransform with InfoTransformer {
4949
def transformArg(arg: Tree, formal: Type): Tree = formal match {
5050
case _: ExprType =>
5151
arg match {
52-
case Apply(Select(qual, nme.apply), Nil) => qual
52+
case Apply(Select(qual, nme.apply), Nil) if qual.tpe <:< defn.FunctionClass(0).typeRef => qual
5353
case _ =>
5454
val meth = ctx.newSymbol(ctx.owner, nme.ANON_FUN, Synthetic,
5555
MethodType(Nil, Nil, arg.tpe.widen))

0 commit comments

Comments
 (0)