@@ -1685,7 +1685,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
16851685 case mt : MethodType =>
16861686 pt.findFunctionType match {
16871687 case pt @ SAMType (sam)
1688- if ! defn.isFunctionType (pt) && mt <:< sam =>
1688+ if ! defn.isFunctionNType (pt) && mt <:< sam =>
16891689 // SAMs of the form C[?] where C is a class cannot be conversion targets.
16901690 // The resulting class `class $anon extends C[?] {...}` would be illegal,
16911691 // since type arguments to `C`'s super constructor cannot be constructed.
@@ -2935,7 +2935,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
29352935
29362936 def typedAsFunction (tree : untpd.PostfixOp , pt : Type )(using Context ): Tree = {
29372937 val untpd .PostfixOp (qual, Ident (nme.WILDCARD )) = tree : @ unchecked
2938- val pt1 = if (defn.isFunctionType (pt)) pt else AnyFunctionProto
2938+ val pt1 = if (defn.isFunctionNType (pt)) pt else AnyFunctionProto
29392939 val nestedCtx = ctx.fresh.setNewTyperState()
29402940 val res = typed(qual, pt1)(using nestedCtx)
29412941 res match {
@@ -3957,7 +3957,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
39573957 sym.isConstructor
39583958 || sym.matchNullaryLoosely
39593959 || Feature .warnOnMigration(msg, tree.srcPos, version = `3.0`)
3960- && {
3960+ && {
39613961 msg.actions
39623962 .headOption
39633963 .foreach(Rewrites .applyAction)
@@ -3990,7 +3990,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
39903990 // Ignore `.apply` in `m.apply(...)`; it will later be simplified in typedSelect to `m(...)`
39913991 adapt1(tree, pt1, locked)
39923992 else
3993- if (! defn.isFunctionType (pt))
3993+ if (! defn.isFunctionNType (pt))
39943994 pt match {
39953995 case SAMType (_) if ! pt.classSymbol.hasAnnotation(defn.FunctionalInterfaceAnnot ) =>
39963996 report.warning(em " ${tree.symbol} is eta-expanded even though $pt does not have the @FunctionalInterface annotation. " , tree.srcPos)
@@ -4108,7 +4108,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
41084108
41094109 def adaptNoArgs (wtp : Type ): Tree = {
41104110 val ptNorm = underlyingApplied(pt)
4111- def functionExpected = defn.isFunctionType (ptNorm)
4111+ def functionExpected = defn.isFunctionNType (ptNorm)
41124112 def needsEta = pt.revealIgnored match
41134113 case _ : SingletonType | _ : FunOrPolyProto => false
41144114 case _ => true
@@ -4198,7 +4198,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
41984198 // convert function literal to SAM closure
41994199 tree match {
42004200 case closure(Nil , id @ Ident (nme.ANON_FUN ), _)
4201- if defn.isFunctionType (wtp) && ! defn.isFunctionType (pt) =>
4201+ if defn.isFunctionNType (wtp) && ! defn.isFunctionNType (pt) =>
42024202 pt match {
42034203 case SAMType (sam)
42044204 if wtp <:< sam.toFunctionType(isJava = pt.classSymbol.is(JavaDefined )) =>
0 commit comments