Skip to content

Commit 46aec62

Browse files
authored
Merge pull request #8192 from dotty-staging/rename-implicit-functions
Rename *ImplicitFunctionN to *ContextFunctionN
2 parents 6466611 + b3b3c11 commit 46aec62

File tree

22 files changed

+136
-136
lines changed

22 files changed

+136
-136
lines changed

compiler/src/dotty/tools/dotc/ast/TreeInfo.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ trait UntypedTreeInfo extends TreeInfo[Untyped] { self: Trees.Instance[Untyped]
298298
def isFunctionWithUnknownParamType(tree: Tree): Boolean =
299299
functionWithUnknownParamType(tree).isDefined
300300

301-
/** Is `tree` an implicit function or closure, possibly nested in a block? */
301+
/** Is `tree` an context function or closure, possibly nested in a block? */
302302
def isContextualClosure(tree: Tree)(implicit ctx: Context): Boolean = unsplice(tree) match {
303303
case tree: FunctionWithMods => tree.mods.is(Given)
304304
case Function((param: untpd.ValDef) :: _, _) => param.mods.is(Given)
@@ -307,7 +307,7 @@ trait UntypedTreeInfo extends TreeInfo[Untyped] { self: Trees.Instance[Untyped]
307307
case Block(DefDef(nme.ANON_FUN, _, params :: _, _, _) :: Nil, cl: Closure) =>
308308
params match {
309309
case param :: _ => param.mods.is(Given)
310-
case Nil => cl.tpt.eq(untpd.ContextualEmptyTree) || defn.isImplicitFunctionType(cl.tpt.typeOpt)
310+
case Nil => cl.tpt.eq(untpd.ContextualEmptyTree) || defn.isContextFunctionType(cl.tpt.typeOpt)
311311
}
312312
case _ => false
313313
}

compiler/src/dotty/tools/dotc/core/Definitions.scala

+34-34
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class Definitions {
7676
newClassSymbol(ScalaPackageClass, name, Artifact, completer).entered
7777
}
7878

79-
/** The trait FunctionN, ImplicitFunctionN, ErasedFunctionN or ErasedImplicitFunction, for some N
79+
/** The trait FunctionN, ContextFunctionN, ErasedFunctionN or ErasedContextFunction, for some N
8080
* @param name The name of the trait to be created
8181
*
8282
* FunctionN traits follow this template:
@@ -89,9 +89,9 @@ class Definitions {
8989
* standard library, but without `tupled` and `curried` methods and without
9090
* a `toString`.
9191
*
92-
* ImplicitFunctionN traits follow this template:
92+
* ContextFunctionN traits follow this template:
9393
*
94-
* trait ImplicitFunctionN[T0,...,T{N-1}, R] extends Object {
94+
* trait ContextFunctionN[T0,...,T{N-1}, R] extends Object {
9595
* def apply(given $x0: T0, ..., $x{N_1}: T{N-1}): R
9696
* }
9797
*
@@ -101,13 +101,13 @@ class Definitions {
101101
* def apply(erased $x0: T0, ..., $x{N_1}: T{N-1}): R
102102
* }
103103
*
104-
* ErasedImplicitFunctionN traits follow this template:
104+
* ErasedContextFunctionN traits follow this template:
105105
*
106-
* trait ErasedImplicitFunctionN[T0,...,T{N-1}, R] extends Object {
106+
* trait ErasedContextFunctionN[T0,...,T{N-1}, R] extends Object {
107107
* def apply (given erased $x0: T0, ..., $x{N_1}: T{N-1}): R
108108
* }
109109
*
110-
* ErasedFunctionN and ErasedImplicitFunctionN erase to Function0.
110+
* ErasedFunctionN and ErasedContextFunctionN erase to Function0.
111111
*/
112112
def newFunctionNTrait(name: TypeName): ClassSymbol = {
113113
val completer = new LazyType {
@@ -122,7 +122,7 @@ class Definitions {
122122
val resParamRef = enterTypeParam(cls, paramNamePrefix ++ "R", Covariant, decls).typeRef
123123
val methodType = MethodType.companion(
124124
isJava = false,
125-
isContextual = name.isImplicitFunction,
125+
isContextual = name.isContextFunction,
126126
isImplicit = false,
127127
isErased = name.isErasedFunction)
128128
decls.enter(newMethod(cls, nme.apply, methodType(argParamRefs, resParamRef), Deferred))
@@ -131,7 +131,7 @@ class Definitions {
131131
}
132132
}
133133
val flags0 = Trait | NoInits
134-
val flags = if (name.isImplicitFunction) flags0 | Final else flags0
134+
val flags = if (name.isContextFunction) flags0 | Final else flags0
135135
newClassSymbol(ScalaPackageClass, name, flags, completer)
136136
}
137137

@@ -878,7 +878,7 @@ class Definitions {
878878
if (isFunctionClass(tsym)) {
879879
val targs = ft.dealias.argInfos
880880
if (targs.isEmpty) None
881-
else Some(targs.init, targs.last, tsym.name.isImplicitFunction, tsym.name.isErasedFunction)
881+
else Some(targs.init, targs.last, tsym.name.isContextFunction, tsym.name.isErasedFunction)
882882
}
883883
else None
884884
}
@@ -998,9 +998,9 @@ class Definitions {
998998

999999
def FunctionClass(n: Int, isContextual: Boolean = false, isErased: Boolean = false)(implicit ctx: Context): Symbol =
10001000
if (isContextual && isErased)
1001-
ctx.requiredClass("scala.ErasedImplicitFunction" + n.toString)
1001+
ctx.requiredClass("scala.ErasedContextFunction" + n.toString)
10021002
else if (isContextual)
1003-
ctx.requiredClass("scala.ImplicitFunction" + n.toString)
1003+
ctx.requiredClass("scala.ContextFunction" + n.toString)
10041004
else if (isErased)
10051005
ctx.requiredClass("scala.ErasedFunction" + n.toString)
10061006
else if (n <= MaxImplementedFunctionArity)
@@ -1047,28 +1047,28 @@ class Definitions {
10471047
/** Is a function class.
10481048
* - FunctionXXL
10491049
* - FunctionN for N >= 0
1050-
* - ImplicitFunctionN for N >= 0
1050+
* - ContextFunctionN for N >= 0
10511051
* - ErasedFunctionN for N > 0
1052-
* - ErasedImplicitFunctionN for N > 0
1052+
* - ErasedContextFunctionN for N > 0
10531053
*/
10541054
def isFunctionClass(cls: Symbol): Boolean = scalaClassName(cls).isFunction
10551055

1056-
/** Is an implicit function class.
1057-
* - ImplicitFunctionN for N >= 0
1058-
* - ErasedImplicitFunctionN for N > 0
1056+
/** Is an context function class.
1057+
* - ContextFunctionN for N >= 0
1058+
* - ErasedContextFunctionN for N > 0
10591059
*/
1060-
def isImplicitFunctionClass(cls: Symbol): Boolean = scalaClassName(cls).isImplicitFunction
1060+
def isContextFunctionClass(cls: Symbol): Boolean = scalaClassName(cls).isContextFunction
10611061

10621062
/** Is an erased function class.
10631063
* - ErasedFunctionN for N > 0
1064-
* - ErasedImplicitFunctionN for N > 0
1064+
* - ErasedContextFunctionN for N > 0
10651065
*/
10661066
def isErasedFunctionClass(cls: Symbol): Boolean = scalaClassName(cls).isErasedFunction
10671067

10681068
/** Is either FunctionXXL or a class that will be erased to FunctionXXL
10691069
* - FunctionXXL
10701070
* - FunctionN for N >= 22
1071-
* - ImplicitFunctionN for N >= 22
1071+
* - ContextFunctionN for N >= 22
10721072
*/
10731073
def isXXLFunctionClass(cls: Symbol): Boolean = {
10741074
val name = scalaClassName(cls)
@@ -1077,9 +1077,9 @@ class Definitions {
10771077

10781078
/** Is a synthetic function class
10791079
* - FunctionN for N > 22
1080-
* - ImplicitFunctionN for N >= 0
1080+
* - ContextFunctionN for N >= 0
10811081
* - ErasedFunctionN for N > 0
1082-
* - ErasedImplicitFunctionN for N > 0
1082+
* - ErasedContextFunctionN for N > 0
10831083
*/
10841084
def isSyntheticFunctionClass(cls: Symbol): Boolean = scalaClassName(cls).isSyntheticFunction
10851085

@@ -1093,8 +1093,8 @@ class Definitions {
10931093
/** Returns the erased class of the function class `cls`
10941094
* - FunctionN for N > 22 becomes FunctionXXL
10951095
* - FunctionN for 22 > N >= 0 remains as FunctionN
1096-
* - ImplicitFunctionN for N > 22 becomes FunctionXXL
1097-
* - ImplicitFunctionN for N <= 22 becomes FunctionN
1096+
* - ContextFunctionN for N > 22 becomes FunctionXXL
1097+
* - ContextFunctionN for N <= 22 becomes FunctionN
10981098
* - ErasedFunctionN becomes Function0
10991099
* - ImplicitErasedFunctionN becomes Function0
11001100
* - anything else becomes a NoSymbol
@@ -1110,8 +1110,8 @@ class Definitions {
11101110
/** Returns the erased type of the function class `cls`
11111111
* - FunctionN for N > 22 becomes FunctionXXL
11121112
* - FunctionN for 22 > N >= 0 remains as FunctionN
1113-
* - ImplicitFunctionN for N > 22 becomes FunctionXXL
1114-
* - ImplicitFunctionN for N <= 22 becomes FunctionN
1113+
* - ContextFunctionN for N > 22 becomes FunctionXXL
1114+
* - ContextFunctionN for N <= 22 becomes FunctionN
11151115
* - ErasedFunctionN becomes Function0
11161116
* - ImplicitErasedFunctionN becomes Function0
11171117
* - anything else becomes a NoType
@@ -1194,7 +1194,7 @@ class Definitions {
11941194

11951195
def isProductSubType(tp: Type)(implicit ctx: Context): Boolean = tp.derivesFrom(ProductClass)
11961196

1197-
/** Is `tp` (an alias) of either a scala.FunctionN or a scala.ImplicitFunctionN
1197+
/** Is `tp` (an alias) of either a scala.FunctionN or a scala.ContextFunctionN
11981198
* instance?
11991199
*/
12001200
def isNonRefinedFunction(tp: Type)(implicit ctx: Context): Boolean = {
@@ -1203,7 +1203,7 @@ class Definitions {
12031203

12041204
arity >= 0 &&
12051205
isFunctionClass(sym) &&
1206-
tp.isRef(FunctionType(arity, sym.name.isImplicitFunction, sym.name.isErasedFunction).typeSymbol) &&
1206+
tp.isRef(FunctionType(arity, sym.name.isContextFunction, sym.name.isErasedFunction).typeSymbol) &&
12071207
!tp.isInstanceOf[RefinedType]
12081208
}
12091209

@@ -1251,24 +1251,24 @@ class Definitions {
12511251

12521252
def functionArity(tp: Type)(implicit ctx: Context): Int = tp.dropDependentRefinement.dealias.argInfos.length - 1
12531253

1254-
/** Return underlying immplicit function type (i.e. instance of an ImplicitFunctionN class)
1254+
/** Return underlying context function type (i.e. instance of an ContextFunctionN class)
12551255
* or NoType if none exists. The following types are considered as underlying types:
12561256
* - the alias of an alias type
12571257
* - the instance or origin of a TypeVar (i.e. the result of a stripTypeVar)
12581258
* - the upper bound of a TypeParamRef in the current constraint
12591259
*/
1260-
def asImplicitFunctionType(tp: Type)(implicit ctx: Context): Type =
1260+
def asContextFunctionType(tp: Type)(implicit ctx: Context): Type =
12611261
tp.stripTypeVar.dealias match {
12621262
case tp1: TypeParamRef if ctx.typerState.constraint.contains(tp1) =>
1263-
asImplicitFunctionType(ctx.typeComparer.bounds(tp1).hiBound)
1263+
asContextFunctionType(ctx.typeComparer.bounds(tp1).hiBound)
12641264
case tp1 =>
1265-
if (isFunctionType(tp1) && tp1.typeSymbol.name.isImplicitFunction) tp1
1265+
if (isFunctionType(tp1) && tp1.typeSymbol.name.isContextFunction) tp1
12661266
else NoType
12671267
}
12681268

1269-
/** Is `tp` an implicit function type? */
1270-
def isImplicitFunctionType(tp: Type)(implicit ctx: Context): Boolean =
1271-
asImplicitFunctionType(tp).exists
1269+
/** Is `tp` an context function type? */
1270+
def isContextFunctionType(tp: Type)(implicit ctx: Context): Boolean =
1271+
asContextFunctionType(tp).exists
12721272

12731273
def isErasedFunctionType(tp: Type)(implicit ctx: Context): Boolean =
12741274
isFunctionType(tp) && tp.dealias.typeSymbol.name.isErasedFunction

compiler/src/dotty/tools/dotc/core/NameOps.scala

+12-12
Original file line numberDiff line numberDiff line change
@@ -150,38 +150,38 @@ object NameOps {
150150

151151
def functionArity: Int =
152152
functionArityFor(str.Function) max
153-
functionArityFor(str.ImplicitFunction) max {
153+
functionArityFor(str.ContextFunction) max {
154154
val n =
155155
functionArityFor(str.ErasedFunction) max
156-
functionArityFor(str.ErasedImplicitFunction)
156+
functionArityFor(str.ErasedContextFunction)
157157
if (n == 0) -1 else n
158158
}
159159

160-
/** Is a function name, i.e one of FunctionXXL, FunctionN, ImplicitFunctionN for N >= 0 or ErasedFunctionN, ErasedImplicitFunctionN for N > 0
160+
/** Is a function name, i.e one of FunctionXXL, FunctionN, ContextFunctionN for N >= 0 or ErasedFunctionN, ErasedContextFunctionN for N > 0
161161
*/
162162
def isFunction: Boolean = (name eq tpnme.FunctionXXL) || functionArity >= 0
163163

164-
/** Is an implicit function name, i.e one of ImplicitFunctionN for N >= 0 or ErasedImplicitFunctionN for N > 0
164+
/** Is an context function name, i.e one of ContextFunctionN for N >= 0 or ErasedContextFunctionN for N > 0
165165
*/
166-
def isImplicitFunction: Boolean =
167-
functionArityFor(str.ImplicitFunction) >= 0 ||
168-
functionArityFor(str.ErasedImplicitFunction) > 0
166+
def isContextFunction: Boolean =
167+
functionArityFor(str.ContextFunction) >= 0 ||
168+
functionArityFor(str.ErasedContextFunction) > 0
169169

170-
/** Is an erased function name, i.e. one of ErasedFunctionN, ErasedImplicitFunctionN for N > 0
170+
/** Is an erased function name, i.e. one of ErasedFunctionN, ErasedContextFunctionN for N > 0
171171
*/
172172
def isErasedFunction: Boolean =
173173
functionArityFor(str.ErasedFunction) > 0 ||
174-
functionArityFor(str.ErasedImplicitFunction) > 0
174+
functionArityFor(str.ErasedContextFunction) > 0
175175

176176
/** Is a synthetic function name, i.e. one of
177177
* - FunctionN for N > 22
178-
* - ImplicitFunctionN for N >= 0
178+
* - ContextFunctionN for N >= 0
179179
* - ErasedFunctionN for N > 0
180-
* - ErasedImplicitFunctionN for N > 0
180+
* - ErasedContextFunctionN for N > 0
181181
*/
182182
def isSyntheticFunction: Boolean =
183183
functionArityFor(str.Function) > MaxImplementedFunctionArity ||
184-
functionArityFor(str.ImplicitFunction) >= 0 ||
184+
functionArityFor(str.ContextFunction) >= 0 ||
185185
isErasedFunction
186186

187187
/** Parsed function arity for function with some specific prefix */

compiler/src/dotty/tools/dotc/core/StdNames.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ object StdNames {
3535

3636
final val Function = "Function"
3737
final val ErasedFunction = "ErasedFunction"
38-
final val ImplicitFunction = "ImplicitFunction"
39-
final val ErasedImplicitFunction = "ErasedImplicitFunction"
38+
final val ContextFunction = "ContextFunction"
39+
final val ErasedContextFunction = "ErasedContextFunction"
4040
final val AbstractFunction = "AbstractFunction"
4141
final val Tuple = "Tuple"
4242
final val Product = "Product"

compiler/src/dotty/tools/dotc/core/TypeErasure.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean
413413
* - For a typeref scala.Any, scala.AnyVal, scala.Singleton, scala.Tuple, or scala.*: : |java.lang.Object|
414414
* - For a typeref scala.Unit, |scala.runtime.BoxedUnit|.
415415
* - For a typeref scala.FunctionN, where N > MaxImplementedFunctionArity, scala.FunctionXXL
416-
* - For a typeref scala.ImplicitFunctionN, | scala.FunctionN |
416+
* - For a typeref scala.ContextFunctionN, | scala.FunctionN |
417417
* - For a typeref P.C where C refers to a class, <noprefix> # C.
418418
* - For a typeref P.C where C refers to an alias type, the erasure of C's alias.
419419
* - For a typeref P.C where C refers to an abstract type, the erasure of C's upper bound.

compiler/src/dotty/tools/dotc/core/Types.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -4634,7 +4634,7 @@ object Types {
46344634
case et: ExprType => true
46354635
case _ => false
46364636
}
4637-
// `ImplicitFunctionN` does not have constructors
4637+
// `ContextFunctionN` does not have constructors
46384638
val ctor = tp.cls.primaryConstructor
46394639
if (!ctor.exists || zeroParams(ctor.info)) tp
46404640
else NoType
@@ -4664,7 +4664,7 @@ object Types {
46644664
if (absMems.size == 1)
46654665
absMems.head.info match {
46664666
case mt: MethodType if !mt.isParamDependent &&
4667-
!defn.isImplicitFunctionType(mt.resultType) =>
4667+
!defn.isContextFunctionType(mt.resultType) =>
46684668
val cls = tp.classSymbol
46694669

46704670
// Given a SAM type such as:

compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
195195
case tp @ AppliedType(tycon, args) =>
196196
val cls = tycon.typeSymbol
197197
if (tycon.isRepeatedParam) toTextLocal(args.head) ~ "*"
198-
else if (defn.isFunctionClass(cls)) toTextFunction(args, cls.name.isImplicitFunction, cls.name.isErasedFunction)
198+
else if (defn.isFunctionClass(cls)) toTextFunction(args, cls.name.isContextFunction, cls.name.isErasedFunction)
199199
else if (tp.tupleArity >= 2 && !printDebug) toTextTuple(tp.tupleElementTypes)
200200
else if (isInfixType(tp)) {
201201
val l :: r :: Nil = args

compiler/src/dotty/tools/dotc/tastyreflect/ReflectionCompilerInterface.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -1191,8 +1191,8 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
11911191
def Type_isFunctionType(self: Type)(given Context): Boolean =
11921192
defn.isFunctionType(self)
11931193

1194-
def Type_isImplicitFunctionType(self: Type)(given Context): Boolean =
1195-
defn.isImplicitFunctionType(self)
1194+
def Type_isContextFunctionType(self: Type)(given Context): Boolean =
1195+
defn.isContextFunctionType(self)
11961196

11971197
def Type_isErasedFunctionType(self: Type)(given Context): Boolean =
11981198
defn.isErasedFunctionType(self)

compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ExpandSAMs extends MiniPhase {
3636
tpt.tpe match {
3737
case NoType =>
3838
tree // it's a plain function
39-
case tpe if defn.isImplicitFunctionType(tpe) =>
39+
case tpe if defn.isContextFunctionType(tpe) =>
4040
tree
4141
case tpe @ SAMType(_) if tpe.isRef(defn.PartialFunctionClass) =>
4242
val tpe1 = checkRefinements(tpe, fn)

compiler/src/dotty/tools/dotc/transform/ShortcutImplicits.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class ShortcutImplicits extends MiniPhase with IdentityDenotTransformer { thisPh
8585
/** Transform `qual.apply` occurrences according to rewrite rule (2) above */
8686
override def transformSelect(tree: Select)(implicit ctx: Context): Tree =
8787
if (tree.name == nme.apply &&
88-
defn.isImplicitFunctionType(tree.qualifier.tpe.widen) &&
88+
defn.isContextFunctionType(tree.qualifier.tpe.widen) &&
8989
needsImplicitShortcut(tree.qualifier.symbol)) {
9090
def directQual(tree: Tree): Tree = tree match {
9191
case Apply(fn, args) => cpy.Apply(tree)(directQual(fn), args)
@@ -165,7 +165,7 @@ object ShortcutImplicits {
165165
*/
166166
def needsImplicitShortcut(sym: Symbol)(implicit ctx: Context): Boolean =
167167
sym.is(Method, butNot = Accessor) &&
168-
defn.isImplicitFunctionType(sym.info.finalResultType) &&
168+
defn.isContextFunctionType(sym.info.finalResultType) &&
169169
defn.functionArity(sym.info.finalResultType) > 0 &&
170170
!sym.isAnonymousFunction &&
171171
(specializeMonoTargets || !sym.isEffectivelyFinal || sym.allOverriddenSymbols.nonEmpty)

compiler/src/dotty/tools/dotc/transform/Splicer.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ object Splicer {
313313
}
314314

315315
def getDirectName(tp: Type, name: TermName): TermName = tp.widenDealias match {
316-
case tp: AppliedType if defn.isImplicitFunctionType(tp) =>
316+
case tp: AppliedType if defn.isContextFunctionType(tp) =>
317317
getDirectName(tp.args.last, NameKinds.DirectMethodName(name))
318318
case _ => name
319319
}
@@ -468,8 +468,8 @@ object Splicer {
468468
else java.lang.Class.forName(javaSig(param), false, classLoader)
469469
}
470470
def getExtraParams(tp: Type): List[Type] = tp.widenDealias match {
471-
case tp: AppliedType if defn.isImplicitFunctionType(tp) =>
472-
// Call implicit function type direct method
471+
case tp: AppliedType if defn.isContextFunctionType(tp) =>
472+
// Call context function type direct method
473473
tp.args.init.map(arg => TypeErasure.erasure(arg)) ::: getExtraParams(tp.args.last)
474474
case _ => Nil
475475
}
@@ -496,7 +496,7 @@ object Splicer {
496496

497497
private object Call0 {
498498
def unapply(arg: Tree)(implicit ctx: Context): Option[(RefTree, List[List[Tree]])] = arg match {
499-
case Select(Call0(fn, args), nme.apply) if defn.isImplicitFunctionType(fn.tpe.widenDealias.finalResultType) =>
499+
case Select(Call0(fn, args), nme.apply) if defn.isContextFunctionType(fn.tpe.widenDealias.finalResultType) =>
500500
Some((fn, args))
501501
case fn: RefTree => Some((fn, Nil))
502502
case Apply(f @ Call0(fn, args1), args2) =>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ trait Implicits { self: Typer =>
741741
(formal, span) => implicit ctx => formal match {
742742
case AppliedType(_, funArgs @ fun :: tupled :: Nil) =>
743743
def functionTypeEqual(baseFun: Type, actualArgs: List[Type], actualRet: Type, expected: Type) =
744-
expected =:= defn.FunctionOf(actualArgs, actualRet, defn.isImplicitFunctionType(baseFun), defn.isErasedFunctionType(baseFun))
744+
expected =:= defn.FunctionOf(actualArgs, actualRet, defn.isContextFunctionType(baseFun), defn.isErasedFunctionType(baseFun))
745745
val arity: Int =
746746
if (defn.isErasedFunctionType(fun) || defn.isErasedFunctionType(fun)) -1 // TODO support?
747747
else if (defn.isFunctionType(fun))

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ object ProtoTypes {
588588
case et: ExprType =>
589589
normalize(et.resultType, pt)
590590
case wtp =>
591-
val iftp = defn.asImplicitFunctionType(wtp)
591+
val iftp = defn.asContextFunctionType(wtp)
592592
if (iftp.exists) normalize(iftp.dropDependentRefinement.argInfos.last, pt) else tp
593593
}
594594
}

0 commit comments

Comments
 (0)