valyukov
Dialyzer listed not implemented protocols as `Unknown functions`
I use protocols in my project. When I run mix dialyzer, it returns list of not implemented protocols in Unknown functions: section.
e.g.
'Elixir.Store.Protocols.Paycode.Atom':'__impl__'/1
does anybody know how to fix it?
Trending in Questions
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated!
To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead.
Sta...
New
Hello !
We want new/edit form pages to POST/PUT to their own URL rather than the resources REST defaults (post /things, put /things/:id)...
New
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app?
Looking for hints regarding:
Addi...
New
Hi all, I wanted to ask how the community is dealing with post-release steps.
Today we have Ecto migrations, which make sure that the db...
New
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #elixirconf-us
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #performance
- #security











First 10 of 14 Posts!
Eiji
Do you have your protocol implemented for
Atomtype?If not and you don’t want to implement it you can try set
@fallback_to_anyand in the implementation forAnythen returnnil.See this link for details of the protocols and implementation for
Any.If I understand it correctly this tool checks: “what will happen if someone run a protocol method with …”.
If you do not want to implement fallback you need to find a configuration/flag/option to disable missing protocol implementations.
Here you have specified how to use flags, but I don’t know if there is any to disable this warning.
valyukov
Thank you for your replay,
I implement protocol for
Anyand add@fallback_to_any trueto protocol, but dialyzer continuous to return this warnings.Did I do something wrong?
Eiji
Hmm, I read some about this tool. It’s not a problem with
@fallback_to_any.On stackoverflow this line putted in protocol definition solved the problem
but it’s not working for me.
Environment:
Steps to reproduce:
mix newcommand.{:dialyxir, "~> 0.3.5", only: [:dev]}to your example app dependencies list.mix deps.getand:mix deps.compilemix dialyzer.pltmix dialyzerExpected behaviour:
Dialyzer should not produce any warning messages.
Actual behaviour:
Dialyzer returned many warning (unknown functions) for Elixir protocol implementations:
Atom,BitString,Float,Function,List,Map,PID,Port,ReferenceandTuple.What do you think about it @jeremyjh?
jeremyjh
Hi, I don’t know that there is a way to suppress the unknown warnings. I think in that stack overflow thread they were suggesting the
:nowarn_functionattribute to deal with the warning about the inferred type/vs specification.The unknown function warnings do not change the exit status, they are more of a warning that the analysis is incomplete. But yes they are ugly. Unfortunately this is the state of dialyzer in Elixir presently.
Right now
dialyxirdoes not do anything to alter the output ofdialyzer, its just shelling out to the dialyzer and dumping the results. I think some suppression would be a good feature here, I can definitely add this to my list.Eiji
hmmm
How it was resolved on stackoverflow?
I was think that it was possible to solve for example in previous version of dialyxir …
I think this feature should be configurable in 4 ways:
jeremyjh
On stack overflow there were two different problems and the solution resolved only the “first” problem. The unknown functions in the second warning are on
__impl__, not on protocol.I can’t add any new attribute support to dialyzer; dialyxir isn’t inspecting BEAM files it just manages the PLT for you and executes the Erlang Dialyzer. But since I get the shell output and in this case there is no change in exit status, I could “erase” the unwanted messages that have to do with unknown impl and yes it would be configurable to enable/disable.
OvermindDL1
My dyalizer output is run through sed to remove things I don’t want to see that upstream libraries have borked, definitely ugly. ^.^
Eiji
Oh sorry, I thought that the solution applies to both problems.
So how
@dialyzer {:nowarn_function, __protocol__: 1}could work?Exit status may be important. For example in bash:
command_a && command_b.jeremyjh
FYI - thanks to @melpon - Dialyxir now supports a way to ignore known warnings.
Joseph
I’ve come across this too.
The output says Dialyzer is complaining because it can’t find the
__impl__/1functions.I figure it can’t find them because Dialyxir only tells it to look in the
ebindirectory by default (see the Path section in the README). Protocols are “consolidated” and the.beamfiles make their way into aconsolidateddirectory under_build.I resolved the warnings by adding the following to my Dialyzer configuration (with the above in mind):
This way I thought it’d know where to find them. I does resolve the warnings but…
I can’t find the modules it complains about. Not sure how it resolves the warnings but it looks like a good solution to me
Last Post!
im-tollu
@NobbZ, thanks!
Well, I used
to switch off consolidation - and still get the same error.
Here is the ticket: https://github.com/elixir-lang/elixir/issues/7708