File tree 1 file changed +5
-8
lines changed
compiler/src/dotty/tools/dotc/core
1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -1116,16 +1116,13 @@ class Definitions {
1116
1116
else
1117
1117
FunctionType (args.length, isContextual).appliedTo(args ::: resultType :: Nil )
1118
1118
def unapply (ft : Type )(using Context ): Option [(List [Type ], Type , Boolean )] = {
1119
- ft.dealias match
1119
+ ft match
1120
1120
case PolyFunctionOf (mt : MethodType ) =>
1121
1121
Some (mt.paramInfos, mt.resType, mt.isContextualMethod)
1122
- case dft =>
1123
- val tsym = dft.typeSymbol
1124
- if isFunctionSymbol(tsym) && ft.isRef(tsym) then
1125
- val targs = dft.argInfos
1126
- if (targs.isEmpty) None
1127
- else Some (targs.init, targs.last, tsym.name.isContextFunction)
1128
- else None
1122
+ case AppliedType (parent, targs) if targs.nonEmpty && isFunctionNType(ft) =>
1123
+ Some (targs.init, targs.last, ft.typeSymbol.name.isContextFunction)
1124
+ case _ =>
1125
+ None
1129
1126
}
1130
1127
}
1131
1128
You can’t perform that action at this time.
0 commit comments