Replace :erlang.exit with :erlang.nif_error to suppress Dialyzer warnings#5
Open
japhib wants to merge 1 commit intoIanleeclark:masterfrom
Open
Replace :erlang.exit with :erlang.nif_error to suppress Dialyzer warnings#5japhib wants to merge 1 commit intoIanleeclark:masterfrom
japhib wants to merge 1 commit intoIanleeclark:masterfrom
Conversation
…g on this one can use Dialyzer
|
@Ianleeclark Just bumping this since it's been a year and I'm also running into the same issue. |
|
Thank you so much for this @japhib! I spent much time trying to figure out why Dialyzer was failing for me. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently when you run Dialyzer on a project that depends on libsalty2, you get a warning that every function calling a
libsalty2function will never return. This is because Dialyzer just sees the:erlang.exitin the placeholder implementation and thinks that's the real implementation. The way around this is to use:erlang.nif_errorin its place: https://www.erlang.org/doc/man/erlang.html#nif_error-1From the docs:
The only functional difference is that it'll raise an error instead of just immediately exiting. I'm assuming that's fine though?