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 @@ -1138,13 +1138,10 @@ class Definitions {
11381138 /** Matches a (possibly aliased) `FunctionN[...]` or `ContextFunctionN[...]`.
11391139 * Extracts the list of function argument types, the result type and whether function is contextual.
11401140 */
1141- def unapply (tpe : Type )(using Context ): Option [(List [Type ], Type , Boolean )] = {
1142- val tsym = tpe.typeSymbol
1143- if isFunctionSymbol(tsym) && tpe.isRef(tsym) then
1144- val targs = tpe.argInfos
1145- if (targs.isEmpty) None
1146- else Some (targs.init, targs.last, tsym.name.isContextFunction)
1147- else None
1141+ def unapply (tpe : AppliedType )(using Context ): Option [(List [Type ], Type , Boolean )] = {
1142+ val targs = tpe.args
1143+ if targs.isEmpty || ! isFunctionNType(tpe) then None
1144+ else Some (targs.init, targs.last, tpe.typeSymbol.name.isContextFunction)
11481145 }
11491146 }
11501147
You can’t perform that action at this time.
0 commit comments