From 9e0e25f342a80e31dc451bf0ea0fea20a0343017 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 1 Aug 2023 19:47:26 +0200 Subject: [PATCH] fix(match): cast to function properly --- src/internals/match/Match.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/internals/match/Match.ts b/src/internals/match/Match.ts index 057d999..87365b1 100644 --- a/src/internals/match/Match.ts +++ b/src/internals/match/Match.ts @@ -59,7 +59,9 @@ export namespace Match { * ]> * ``` */ - export type With = pattern extends Fn ? Impl.With : Impl.With; + export type With = pattern extends infer MatchFn extends Fn ? + Impl.With : + Impl.With; /** * Match.WithEqual matches exactly a type with a handler. * The handler can be any Fn or value type.