File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -1136,13 +1136,10 @@ class Definitions {
11361136 /** Matches a (possibly aliased) `FunctionN[...]` or `ContextFunctionN[...]`.
11371137 * Extracts the list of function argument types, the result type and whether function is contextual.
11381138 */
1139- def unapply (tpe : Type )(using Context ): Option [(List [Type ], Type , Boolean )] = {
1140- val tsym = tpe.typeSymbol
1141- if isFunctionSymbol(tsym) && tpe.isRef(tsym) then
1142- val targs = tpe.argInfos
1143- if (targs.isEmpty) None
1144- else Some (targs.init, targs.last, tsym.name.isContextFunction)
1145- else None
1139+ def unapply (tpe : AppliedType )(using Context ): Option [(List [Type ], Type , Boolean )] = {
1140+ val targs = tpe.args
1141+ if targs.isEmpty || ! isFunctionNType(tpe) then None
1142+ else Some (targs.init, targs.last, tpe.typeSymbol.name.isContextFunction)
11461143 }
11471144 }
11481145
You can’t perform that action at this time.
0 commit comments