Closed iSplasher closed 8 months ago
The second parameter you passed is a lazy Hotscript function, you need to call it (also use $
instead of Call
, it's a short alias and it's this way easier to read) :
type Works<U extends "a" | "b" | "" = ""> = $< Tuples.Map, Match<[
Match.With<"a", { a: true }>,
Match.With<"b", { b: true }>,
Match.With<any, Identity>,
]>, $<Unions.ToTuple,U>>
Think, $
as a way to call Hotscript generic, so :
type Test = $<HotscriptLazyFunc, Param1, Param2>;
is equivalent in standard generics to :
type Test = GenericFunc< Param1, Param2>;
Hi, is this a bug?
Did I miss anything?
Edit: I realize there's a workaround:
However, I'm curious why the above bug example doesn't work.