@@ -1121,15 +1121,19 @@ class Definitions {
11211121 /** Is `tp` (an alias) of either a scala.FunctionN or a scala.ImplicitFunctionN
11221122 * instance?
11231123 */
1124- def isNonDepFunctionType (tp : Type )(implicit ctx : Context ): Boolean = {
1124+ def isNonRefinedFunction (tp : Type )(implicit ctx : Context ): Boolean = {
11251125 val arity = functionArity(tp)
11261126 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 ]
11281132 }
11291133
11301134 /** Is `tp` a representation of a (possibly depenent) function type or an alias of such? */
11311135 def isFunctionType (tp : Type )(implicit ctx : Context ): Boolean =
1132- isNonDepFunctionType (tp.dropDependentRefinement)
1136+ isNonRefinedFunction (tp.dropDependentRefinement)
11331137
11341138 // Specialized type parameters defined for scala.Function{0,1,2}.
11351139 lazy val Function1SpecializedParamTypes : collection.Set [TypeRef ] =
@@ -1169,7 +1173,7 @@ class Definitions {
11691173 false
11701174 })
11711175
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
11731177
11741178 /** Return underlying immplicit function type (i.e. instance of an ImplicitFunctionN class)
11751179 * or NoType if none exists. The following types are considered as underlying types:
0 commit comments