File tree 1 file changed +4
-7
lines changed
compiler/src/dotty/tools/dotc/core
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -1138,13 +1138,10 @@ class Definitions {
1138
1138
/** Matches a (possibly aliased) `FunctionN[...]` or `ContextFunctionN[...]`.
1139
1139
* Extracts the list of function argument types, the result type and whether function is contextual.
1140
1140
*/
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)
1148
1145
}
1149
1146
}
1150
1147
You can’t perform that action at this time.
0 commit comments