Skip to content

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

@ProducerMatt

Description

@ProducerMatt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions