nim-lang / db_connector

Unified db connector in Nim
MIT License
20 stars 6 forks source link

mark `dbQuote` proc param to `dbFormatImpl` as {.nimcall.} #23

Closed metagn closed 9 months ago

metagn commented 9 months ago

By default the type proc (s: string): string assumes {.closure.}, but the uses of dbFormatImpl only refer to implementations of dbQuote in each module which are good enough as {.nimcall.}.

Normally this doesn't matter, but if the rules of how template arguments are converted to argument types change to match normal procs in Nim in the future (as experimented in https://github.com/nim-lang/Nim/pull/23176), the passed dbQuote will be treated as an implicit conversion from a {.nimcall.} proc into a {.closure.} proc, which causes the effect tracker to treat it as an arbitrary procvar and assume it causes RootEffect. This won't necessarily be a problem but we can guard against it for the time being.