-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix bind_* NIF typespecs #318
Conversation
now = :erlang.monotonic_time(:millisecond)
{:ok, stmt} = Exqlite.Sqlite3.prepare(conn, "DELETE FROM queue WHERE expiration <= ?")
:ok = Exqlite.Sqlite3.bind(stmt, [now]) dialyzer complains about the last line:
and in exqlite source there is this: @spec bind_integer(statement, non_neg_integer, integer) :: :ok
def bind_integer(stmt, index, integer) do
case Sqlite3NIF.bind_integer(stmt, index, integer) do
@sqlite_ok -> :ok
rc -> raise Exqlite.Error, message: errmsg(stmt) || errstr(rc)
end
end and this @spec bind_integer(statement, non_neg_integer, integer) :: :ok
def bind_integer(_stmt, _index, _integer), do: :erlang.nif_error(:not_loaded) The return value of
|
😮💨 I could not figure out the dialyzer errors for the life of me. It didn't occur to me to actually check the return from the nif. Can you go ahead and add the dialyzer to the CI as well now 😄 exqlite/.github/workflows/ci.yml Line 38 in fd2492d
|
I'm almost tempted to turn these integers into atoms in a separate PR. Much easier to decipher WTF. |
I'll chuck the ci check in later. Thanks a ton @ademenev. |
It actually fails for me, so I guess adding it would just break CI
Integestingly, ElixirLS does not report those for me, only But al least for projects using the library dialyzer does is not complaining |
I stopped using ElixirLS for the time being. It is slow, eats memory, and causes so much pain. 😭 |
No description provided.