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

@type! declarations referencing specific objects cause Dialyxir errors #188

Open
ProducerMatt opened this issue Sep 23, 2023 · 0 comments
Open

Comments

@ProducerMatt
Copy link

ProducerMatt commented Sep 23, 2023

When writing a @type declaration, I sometimes reference specific objects when I know they're guaranteed, like :ok, or ModuleName. But with @type! (and not @spec! for some reason) this causes a dialyxir error, saying the type name is a function with no return:

lib/service/discord.ex:76:no_return
Function logger_state/0 has no local return.

Even though when executing the code, it runs fine.

This also means some built-in types like Keyword.t() always cause errors, because they reference specific objects.

Erlang/OTP 25 [erts-13.2.2.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]

Elixir 1.15.5 (compiled with Erlang/OTP 25)

Dialyxir 1.4.1

Type Check v0.13.5
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

No branches or pull requests

1 participant