Skip to content

Conversation

@madasebrof
Copy link

The dialyzer doesn't like returning ext/1 from a nif:

def add_numbers(_, _), do: exit(:nif_library_not_loaded)

See https://stackoverflow.com/questions/26612625/erlang-nifs-and-dialyzer-warning

Changed all return values to :erlang.nif_error/1

def add_numbers(_, _), do: :erlang.nif_error(:nif_library_not_loaded)

@jrfondren
Copy link

Your erlangFn changes are incorrect. Erlang's syntax for an atom is just theatom, no leading colon. Erlang's namespace syntax uses a colon, not a dot. Thus,

--- a/nimler/gen_module.nim
+++ b/nimler/gen_module.nim
@@ -35,7 +35,7 @@ $4
 $5
 """
 const erlangFn = """
-  $1($2) -> :erlang.nif_error(:nif_library_not_loaded).
+  $1($2) -> erlang:nif_error(nif_library_not_loaded).
 """

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants