Skip to content

Commit a7f1966

Browse files
committed
Use FunctionNOf
1 parent 3eeadfd commit a7f1966

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

compiler/src/dotty/tools/dotc/cc/Synthetics.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ object Synthetics:
179179
val (et: ExprType) = symd.info: @unchecked
180180
val (enclThis: ThisType) = symd.owner.thisType: @unchecked
181181
def mapFinalResult(tp: Type, f: Type => Type): Type =
182-
val defn.FunctionOf(args, res, isContextual) = tp: @unchecked
182+
val defn.FunctionNOf(args, res, isContextual) = tp: @unchecked
183183
if defn.isFunctionNType(res) then
184-
defn.FunctionOf(args, mapFinalResult(res, f), isContextual)
184+
defn.FunctionNOf(args, mapFinalResult(res, f), isContextual)
185185
else
186186
f(tp)
187187
val resType1 =

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1707,7 +1707,7 @@ trait Applications extends Compatibility {
17071707
def apply(t: Type) = t match {
17081708
case t @ AppliedType(tycon, args) =>
17091709
def mapArg(arg: Type, tparam: TypeParamInfo) =
1710-
if (variance > 0 && tparam.paramVarianceSign < 0) defn.FunctionOf(arg :: Nil, defn.UnitType)
1710+
if (variance > 0 && tparam.paramVarianceSign < 0) defn.FunctionNOf(arg :: Nil, defn.UnitType)
17111711
else arg
17121712
mapOver(t.derivedAppliedType(tycon, args.zipWithConserve(tycon.typeParams)(mapArg)))
17131713
case _ => mapOver(t)

compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ object ProtoTypes {
385385

386386
private def isUndefined(tp: Type): Boolean = tp match {
387387
case _: WildcardType => true
388-
case defn.FunctionOf(args, result, _) => args.exists(isUndefined) || isUndefined(result)
388+
case defn.FunctionNOf(args, result, _) => args.exists(isUndefined) || isUndefined(result)
389389
case _ => false
390390
}
391391

@@ -424,7 +424,7 @@ object ProtoTypes {
424424
case ValDef(_, tpt, _) if !tpt.isEmpty => typer.typedType(tpt).typeOpt
425425
case _ => WildcardType
426426
}
427-
targ = arg.withType(defn.FunctionOf(paramTypes, WildcardType))
427+
targ = arg.withType(defn.FunctionNOf(paramTypes, WildcardType))
428428
case Some(_) if !force =>
429429
targ = arg.withType(WildcardType)
430430
case _ =>

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
13241324
case ft @ defn.FunctionRefinementOf(_, mt @ MethodTpe(_, formals, restpe)) =>
13251325
if formals.length != defaultArity then fallbackProto
13261326
else (formals, untpd.InLambdaTypeTree(isResult = true, (_, syms) => restpe.substParams(mt, syms.map(_.termRef))))
1327-
case ft @ defn.FunctionOf(_, _, _) =>
1327+
case ft @ defn.FunctionNOf(_, _, _) =>
13281328
// if expected parameter type(s) are wildcards, approximate from below.
13291329
// if expected result type is a wildcard, approximate from above.
13301330
// this can type the greatest set of admissible closures.

0 commit comments

Comments
 (0)