We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fa0c231 commit cb34be5Copy full SHA for cb34be5
compiler/src/dotty/tools/dotc/core/Definitions.scala
@@ -1115,7 +1115,7 @@ class Definitions {
1115
def unapply(ft: Type)(using Context): Option[MethodOrPoly] = {
1116
ft match
1117
case RefinedType(parent, nme.apply, mt: MethodOrPoly)
1118
- if parent.derivesFrom(defn.PolyFunctionClass) || isFunctionNType(parent) =>
+ if parent.derivesFrom(defn.PolyFunctionClass) || (mt.isInstanceOf[MethodType] && isFunctionNType(parent)) =>
1119
Some(mt)
1120
case AppliedType(parent, targs) if targs.nonEmpty && isFunctionNType(ft) =>
1121
val isContextual = ft.typeSymbol.name.isContextFunction
0 commit comments