Argument of type 'string' is not assignable to parameter of type 'DynamicReferenceBuilder<never>'.
The following statement, is giving me the error on the title
I have other
fn
calls that don't fail, so Idk what could be the issue
5 Replies
Seems to be an issue with
min
but I don't understand why
For now I fixed it by not using Kysely's min
function
Hey 👋🏻
Thanks for reporting this. Will look into it tomorrow.
Another workaround is to
fn.min<never>("ld.price_btc")
For some odd reason, TS decides that the first generic is any
by default while it should be never
.why should it be never? 😅
max/min are different.
they're bound by their data type, so we know the return type and can enforce it from the column reference.
but we still allow consumer to pass
{return_type} | null
optionally
and partial generics break, yadda yadda
(TS team just scheduled a fix for that btw)
anyway,
string | number | bigint | null = never
allowed checking if user didn't choose return type, with a very simple assertion. = any
requires less simple assertionok ok thanks 🙂