
Fl4m3Ph03n1x
Dialyzer cannot recognize types from dependencies
Background
I have an umbrella app where I use a dependecy called ETS. This dependency has a type called set_options
that I use in some of my specs.
Problem
The code works fine, but dialyzer is complaining. Namely:
lib/web_interface/persistence.ex:11:20:unknown_type
Unknown type: ETS.set_options/0.
________________________________________________________________________________
lib/web_interface/persistence.ex:11:65:unknown_type
Unknown type: ETS.t/0.
Which then cause a ton of cascading errors.
To try and fix this, I added the following to my root mix.exs
file (the one from the umbrella app, not the one from the child app):
def project,
do: [
apps_path: "apps",
version: "2.1.7",
start_permanent: Mix.env() == :prod,
deps: deps(),
dialyzer: [
plt_add_deps: :app_direct,
plt_add_apps: [
:ets
],
plt_core_path: "plts",
plt_local_path: "plts"
]
]
And then run:
mix dialyzer --plt
mix dialyzer
This did not work and the output was the same.
I then tried adding this to the mix.exs
of the child app in question (alongside the previous changes):
def application do
[
mod: {WebInterface.Application, []},
extra_applications: [:logger, :ets]
]
end
Unfortunately, nothing worked and I still get the same dialyzer errors.
Question
How can I fix dialyzer so it recognized types from my dependencies?
Marked As Solved

Fl4m3Ph03n1x
Turns out this was an error from my side, namely I was not interpreting the documentation correctly.
The correct types are:
ETS.KeyValueSet.set_options()
ETS.KeyValueSet.t()
ETS.table_identifier()
This was more apparent from reading the source code as posted in this thread:
Popular Backend topics










Other popular topics










Latest in Backend
Latest (all)
Categories:
Popular Portals
- /elixir
- /opensuse
- /rust
- /kotlin
- /ruby
- /erlang
- /python
- /clojure
- /react
- /quarkus
- /go
- /vapor
- /react-native
- /v
- /wasm
- /django
- /security
- /nodejs
- /centos
- /rails
- /haskell
- /fable
- /gleam
- /js
- /swift
- /deno
- /tailwind
- /assemblyscript
- /laravel
- /symfony
- /phoenix
- /crystal
- /typescript
- /debian
- /adonisjs
- /julia
- /arch-linux
- /svelte
- /spring
- /c-plus-plus
- /preact
- /flutter
- /actix
- /java
- /angular
- /ocaml
- /zig
- /kubuntu
- /scala
- /zotonic
- /vim
- /rocky
- /lisp
- /html
- /keyboards
- /nim
- /vuejs
- /emacs
- /elm
- /nerves