@@ -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
0 commit comments