@@ -1121,15 +1121,19 @@ class Definitions {
1121
1121
/** Is `tp` (an alias) of either a scala.FunctionN or a scala.ImplicitFunctionN
1122
1122
* instance?
1123
1123
*/
1124
- def isNonDepFunctionType (tp : Type )(implicit ctx : Context ): Boolean = {
1124
+ def isNonRefinedFunction (tp : Type )(implicit ctx : Context ): Boolean = {
1125
1125
val arity = functionArity(tp)
1126
1126
val sym = tp.dealias.typeSymbol
1127
- arity >= 0 && isFunctionClass(sym) && tp.isRef(FunctionType (arity, sym.name.isImplicitFunction, sym.name.isErasedFunction).typeSymbol)
1127
+
1128
+ arity >= 0 &&
1129
+ isFunctionClass(sym) &&
1130
+ tp.isRef(FunctionType (arity, sym.name.isImplicitFunction, sym.name.isErasedFunction).typeSymbol) &&
1131
+ ! tp.isInstanceOf [RefinedType ]
1128
1132
}
1129
1133
1130
1134
/** Is `tp` a representation of a (possibly depenent) function type or an alias of such? */
1131
1135
def isFunctionType (tp : Type )(implicit ctx : Context ): Boolean =
1132
- isNonDepFunctionType (tp.dropDependentRefinement)
1136
+ isNonRefinedFunction (tp.dropDependentRefinement)
1133
1137
1134
1138
// Specialized type parameters defined for scala.Function{0,1,2}.
1135
1139
lazy val Function1SpecializedParamTypes : collection.Set [TypeRef ] =
@@ -1169,7 +1173,7 @@ class Definitions {
1169
1173
false
1170
1174
})
1171
1175
1172
- def functionArity (tp : Type )(implicit ctx : Context ): Int = tp.dealias.argInfos.length - 1
1176
+ def functionArity (tp : Type )(implicit ctx : Context ): Int = tp.dropDependentRefinement. dealias.argInfos.length - 1
1173
1177
1174
1178
/** Return underlying immplicit function type (i.e. instance of an ImplicitFunctionN class)
1175
1179
* or NoType if none exists. The following types are considered as underlying types:
0 commit comments