@@ -76,7 +76,7 @@ class Definitions {
76
76
newClassSymbol(ScalaPackageClass , name, Artifact , completer).entered
77
77
}
78
78
79
- /** The trait FunctionN, ImplicitFunctionN , ErasedFunctionN or ErasedImplicitFunction , for some N
79
+ /** The trait FunctionN, ContextFunctionN , ErasedFunctionN or ErasedContextFunction , for some N
80
80
* @param name The name of the trait to be created
81
81
*
82
82
* FunctionN traits follow this template:
@@ -89,9 +89,9 @@ class Definitions {
89
89
* standard library, but without `tupled` and `curried` methods and without
90
90
* a `toString`.
91
91
*
92
- * ImplicitFunctionN traits follow this template:
92
+ * ContextFunctionN traits follow this template:
93
93
*
94
- * trait ImplicitFunctionN [T0,...,T{N-1}, R] extends Object {
94
+ * trait ContextFunctionN [T0,...,T{N-1}, R] extends Object {
95
95
* def apply(given $x0: T0, ..., $x{N_1}: T{N-1}): R
96
96
* }
97
97
*
@@ -101,13 +101,13 @@ class Definitions {
101
101
* def apply(erased $x0: T0, ..., $x{N_1}: T{N-1}): R
102
102
* }
103
103
*
104
- * ErasedImplicitFunctionN traits follow this template:
104
+ * ErasedContextFunctionN traits follow this template:
105
105
*
106
- * trait ErasedImplicitFunctionN [T0,...,T{N-1}, R] extends Object {
106
+ * trait ErasedContextFunctionN [T0,...,T{N-1}, R] extends Object {
107
107
* def apply (given erased $x0: T0, ..., $x{N_1}: T{N-1}): R
108
108
* }
109
109
*
110
- * ErasedFunctionN and ErasedImplicitFunctionN erase to Function0.
110
+ * ErasedFunctionN and ErasedContextFunctionN erase to Function0.
111
111
*/
112
112
def newFunctionNTrait (name : TypeName ): ClassSymbol = {
113
113
val completer = new LazyType {
@@ -122,7 +122,7 @@ class Definitions {
122
122
val resParamRef = enterTypeParam(cls, paramNamePrefix ++ " R" , Covariant , decls).typeRef
123
123
val methodType = MethodType .companion(
124
124
isJava = false ,
125
- isContextual = name.isImplicitFunction ,
125
+ isContextual = name.isContextFunction ,
126
126
isImplicit = false ,
127
127
isErased = name.isErasedFunction)
128
128
decls.enter(newMethod(cls, nme.apply, methodType(argParamRefs, resParamRef), Deferred ))
@@ -131,7 +131,7 @@ class Definitions {
131
131
}
132
132
}
133
133
val flags0 = Trait | NoInits
134
- val flags = if (name.isImplicitFunction ) flags0 | Final else flags0
134
+ val flags = if (name.isContextFunction ) flags0 | Final else flags0
135
135
newClassSymbol(ScalaPackageClass , name, flags, completer)
136
136
}
137
137
@@ -878,7 +878,7 @@ class Definitions {
878
878
if (isFunctionClass(tsym)) {
879
879
val targs = ft.dealias.argInfos
880
880
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)
882
882
}
883
883
else None
884
884
}
@@ -998,9 +998,9 @@ class Definitions {
998
998
999
999
def FunctionClass (n : Int , isContextual : Boolean = false , isErased : Boolean = false )(implicit ctx : Context ): Symbol =
1000
1000
if (isContextual && isErased)
1001
- ctx.requiredClass(" scala.ErasedImplicitFunction " + n.toString)
1001
+ ctx.requiredClass(" scala.ErasedContextFunction " + n.toString)
1002
1002
else if (isContextual)
1003
- ctx.requiredClass(" scala.ImplicitFunction " + n.toString)
1003
+ ctx.requiredClass(" scala.ContextFunction " + n.toString)
1004
1004
else if (isErased)
1005
1005
ctx.requiredClass(" scala.ErasedFunction" + n.toString)
1006
1006
else if (n <= MaxImplementedFunctionArity )
@@ -1047,28 +1047,28 @@ class Definitions {
1047
1047
/** Is a function class.
1048
1048
* - FunctionXXL
1049
1049
* - FunctionN for N >= 0
1050
- * - ImplicitFunctionN for N >= 0
1050
+ * - ContextFunctionN for N >= 0
1051
1051
* - ErasedFunctionN for N > 0
1052
- * - ErasedImplicitFunctionN for N > 0
1052
+ * - ErasedContextFunctionN for N > 0
1053
1053
*/
1054
1054
def isFunctionClass (cls : Symbol ): Boolean = scalaClassName(cls).isFunction
1055
1055
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
1059
1059
*/
1060
- def isImplicitFunctionClass (cls : Symbol ): Boolean = scalaClassName(cls).isImplicitFunction
1060
+ def isContextFunctionClass (cls : Symbol ): Boolean = scalaClassName(cls).isContextFunction
1061
1061
1062
1062
/** Is an erased function class.
1063
1063
* - ErasedFunctionN for N > 0
1064
- * - ErasedImplicitFunctionN for N > 0
1064
+ * - ErasedContextFunctionN for N > 0
1065
1065
*/
1066
1066
def isErasedFunctionClass (cls : Symbol ): Boolean = scalaClassName(cls).isErasedFunction
1067
1067
1068
1068
/** Is either FunctionXXL or a class that will be erased to FunctionXXL
1069
1069
* - FunctionXXL
1070
1070
* - FunctionN for N >= 22
1071
- * - ImplicitFunctionN for N >= 22
1071
+ * - ContextFunctionN for N >= 22
1072
1072
*/
1073
1073
def isXXLFunctionClass (cls : Symbol ): Boolean = {
1074
1074
val name = scalaClassName(cls)
@@ -1077,9 +1077,9 @@ class Definitions {
1077
1077
1078
1078
/** Is a synthetic function class
1079
1079
* - FunctionN for N > 22
1080
- * - ImplicitFunctionN for N >= 0
1080
+ * - ContextFunctionN for N >= 0
1081
1081
* - ErasedFunctionN for N > 0
1082
- * - ErasedImplicitFunctionN for N > 0
1082
+ * - ErasedContextFunctionN for N > 0
1083
1083
*/
1084
1084
def isSyntheticFunctionClass (cls : Symbol ): Boolean = scalaClassName(cls).isSyntheticFunction
1085
1085
@@ -1093,8 +1093,8 @@ class Definitions {
1093
1093
/** Returns the erased class of the function class `cls`
1094
1094
* - FunctionN for N > 22 becomes FunctionXXL
1095
1095
* - 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
1098
1098
* - ErasedFunctionN becomes Function0
1099
1099
* - ImplicitErasedFunctionN becomes Function0
1100
1100
* - anything else becomes a NoSymbol
@@ -1110,8 +1110,8 @@ class Definitions {
1110
1110
/** Returns the erased type of the function class `cls`
1111
1111
* - FunctionN for N > 22 becomes FunctionXXL
1112
1112
* - 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
1115
1115
* - ErasedFunctionN becomes Function0
1116
1116
* - ImplicitErasedFunctionN becomes Function0
1117
1117
* - anything else becomes a NoType
@@ -1194,7 +1194,7 @@ class Definitions {
1194
1194
1195
1195
def isProductSubType (tp : Type )(implicit ctx : Context ): Boolean = tp.derivesFrom(ProductClass )
1196
1196
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
1198
1198
* instance?
1199
1199
*/
1200
1200
def isNonRefinedFunction (tp : Type )(implicit ctx : Context ): Boolean = {
@@ -1203,7 +1203,7 @@ class Definitions {
1203
1203
1204
1204
arity >= 0 &&
1205
1205
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) &&
1207
1207
! tp.isInstanceOf [RefinedType ]
1208
1208
}
1209
1209
@@ -1251,24 +1251,24 @@ class Definitions {
1251
1251
1252
1252
def functionArity (tp : Type )(implicit ctx : Context ): Int = tp.dropDependentRefinement.dealias.argInfos.length - 1
1253
1253
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)
1255
1255
* or NoType if none exists. The following types are considered as underlying types:
1256
1256
* - the alias of an alias type
1257
1257
* - the instance or origin of a TypeVar (i.e. the result of a stripTypeVar)
1258
1258
* - the upper bound of a TypeParamRef in the current constraint
1259
1259
*/
1260
- def asImplicitFunctionType (tp : Type )(implicit ctx : Context ): Type =
1260
+ def asContextFunctionType (tp : Type )(implicit ctx : Context ): Type =
1261
1261
tp.stripTypeVar.dealias match {
1262
1262
case tp1 : TypeParamRef if ctx.typerState.constraint.contains(tp1) =>
1263
- asImplicitFunctionType (ctx.typeComparer.bounds(tp1).hiBound)
1263
+ asContextFunctionType (ctx.typeComparer.bounds(tp1).hiBound)
1264
1264
case tp1 =>
1265
- if (isFunctionType(tp1) && tp1.typeSymbol.name.isImplicitFunction ) tp1
1265
+ if (isFunctionType(tp1) && tp1.typeSymbol.name.isContextFunction ) tp1
1266
1266
else NoType
1267
1267
}
1268
1268
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
1272
1272
1273
1273
def isErasedFunctionType (tp : Type )(implicit ctx : Context ): Boolean =
1274
1274
isFunctionType(tp) && tp.dealias.typeSymbol.name.isErasedFunction
0 commit comments