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 @@ -1136,13 +1136,10 @@ class Definitions {
1136
1136
/** Matches a (possibly aliased) `FunctionN[...]` or `ContextFunctionN[...]`.
1137
1137
* Extracts the list of function argument types, the result type and whether function is contextual.
1138
1138
*/
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)
1146
1143
}
1147
1144
}
1148
1145
You can’t perform that action at this time.
0 commit comments