Skip to content

Commit 9b9d8dd

Browse files
committed
Make FunctionOf match any refined function
Not only dependent refinements
1 parent a325ff7 commit 9b9d8dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,13 +1109,13 @@ class Definitions {
11091109
sym.owner.linkedClass.typeRef
11101110

11111111
object FunctionOf {
1112-
/** Matches a (possibly aliased) `FunctionN[...]`, `ContextFunctionN[...]`, refined `PolyFunction`, or result dependent refinement of `FunctionN[...]`/`ContextFunctionN[...]`.
1112+
/** Matches a `FunctionN[...]`/`ContextFunctionN[...]` or refined `PolyFunction`/`FunctionN[...]`/`ContextFunctionN[...]`.
11131113
* Extracts the method type type and apply info.
11141114
*/
11151115
def unapply(ft: Type)(using Context): Option[MethodOrPoly] = {
11161116
ft match
11171117
case RefinedType(parent, nme.apply, mt: MethodOrPoly)
1118-
if parent.derivesFrom(defn.PolyFunctionClass) || (isFunctionNType(parent) && mt.isResultDependent) =>
1118+
if parent.derivesFrom(defn.PolyFunctionClass) || isFunctionNType(parent) =>
11191119
Some(mt)
11201120
case FunctionNOf(argTypes, resultType, isContextual) =>
11211121
val methodType = if isContextual then ContextualMethodType else MethodType

0 commit comments

Comments
 (0)