File tree 1 file changed +8
-4
lines changed
compiler/src/dotty/tools/dotc/core
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1117,10 +1117,14 @@ class Definitions {
1117
1117
case RefinedType (parent, nme.apply, mt : MethodOrPoly )
1118
1118
if parent.derivesFrom(defn.PolyFunctionClass ) || isFunctionNType(parent) =>
1119
1119
Some (mt)
1120
- case FunctionOf (argTypes, resultType, isContextual) =>
1121
- val methodType = if isContextual then ContextualMethodType else MethodType
1122
- Some (methodType(argTypes, resultType))
1123
- case _ => None
1120
+ case _ =>
1121
+ val tsym = ft.typeSymbol
1122
+ val targs = ft.argInfos
1123
+ if targs.nonEmpty && isFunctionSymbol(tsym) && ft.isRef(tsym) then
1124
+ val isContextual = tsym.name.isContextFunction
1125
+ val methodType = if isContextual then ContextualMethodType else MethodType
1126
+ Some (methodType(targs.init, targs.last))
1127
+ else None
1124
1128
}
1125
1129
}
1126
1130
You can’t perform that action at this time.
0 commit comments