Closed SimenB closed 5 months ago
Hi @SimenB! :)
Ah, this is a good catch actually. I just published a quick fix for this on 0.32.17. In the update, passing <any>
for the generic parameter is permitted (as it does technically pass the TSchema
constraint), however the StaticDecode will infer as unknown
if it detects any
is being passed. I've drafted a bit of info on the fix over at https://github.com/sinclairzx81/typebox/pull/799
Let me know if this helps resolve things :) Cheers! S
Cool, thanks! Using TypeCheck<TUnknown>
is fine in our case (it's really <T extends TSchema = any>
, then TypeCheck<T>
that was in our codebase, and defaulting to TUnknown
rather than any
is a better solution 😀)
While reducing the reproduction I figured out I could use
TypeCheck<TUnknown>
which works, but I thought to still report it 🙂