benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Help with Dialyzer and nowarn_function

Hey folks!

I’ve got a branch in Absinthe that conditionally uses the :persisten_term module if it’s available. Unfortunately this is causing me issues with dialyzer, for reasons I can’t quite sort out. I’d like to do one of two things:

  1. Figure out why dialyzer things :persistent_term.put/2 is unavailable on OTP 21.2. This would be the best option.
  2. If that fails, mark the function as nowarn. I’ve tried this, but I can’t seem to get the invocation correct.

Branch: Persistent Term Backend by benwilson512 · Pull Request #895 · absinthe-graphql/absinthe · GitHub
Failing Travis job: Travis CI
Line where I try to tell dialyzer to ignore stuff: Persistent Term Backend by benwilson512 · Pull Request #895 · absinthe-graphql/absinthe · GitHub

Marked As Solved

kip

kip

ex_cldr Core Team

Sometime in the past, for reasons I don’t recall (but I think i was heading down the same path as you) I added the following to my .dialyzer_ignore_warnings fie which seemed to quiet things down. Hope it helps make some progress.

:0: Unknown function persistent_term:get/2
:0: Unknown function persistent_term:put/2

I think this may also have been because of the @dialyzer issue you are having - i think I had the same but can’t fully recall.

Also Liked

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Hi @kip thanks for the suggestion. I added a file with those lines to that file and at first it didn’t work, but then switched it to using the Elixir formatted documented by dialyxir. This worked!

Commit: Persistent Term Backend by benwilson512 · Pull Request #895 · absinthe-graphql/absinthe · GitHub

Dialyxir format: GitHub - jeremyjh/dialyxir: Mix tasks to simplify use of Dialyzer in Elixir projects. · GitHub

I’d still like to sort out why dialyzer doesn’t think persistent_term.put exists for that version of Erlang though.

tristan

tristan

Rebar3 Core Team

We’ve now hit this issue in OpenTelemetry Fix dialyzer issues by davydog187 · Pull Request #82 · open-telemetry/opentelemetry-erlang-api · GitHub

But what is extra weird is that dialyzer has been working fine, no warnings about persistent_term:put/2. It is only now that Elixir’s dialyxer task has been added that its use of dialyzer warns about the function…

Where Next?

Popular in Questions Top

vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

We're in Beta

About us Mission Statement