Skip to content
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

Fixed Dialyzer warnings #21

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

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