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

Unknown error occurred: %FunctionClauseError{args: nil, arity: 1, clauses: nil, function: :format_long, kind: nil, module: Dialyxir.Warnings.OpaqueTypeTest} #461

Open
nathanl opened this issue Jun 16, 2022 · 1 comment

Comments

@nathanl
Copy link

nathanl commented Jun 16, 2022

Environment

  • Elixir & Erlang/OTP versions (elixir --version):

Elixir 1.13.4 (compiled with Erlang/OTP 25)

More specifically, asdf versions elixir 1.13.4-otp-25 and erlang 25.0.1

  • Which version of Dialyxir are you using? (cat mix.lock | grep dialyxir): 1.1.0

Current behavior

This code:

    name
    |> :ets.whereis()
    |> is_reference()

produces

    # lib/dialyzer_ets_error.ex:7:no_return
    # Function table_exists?/1 has no local return.
    # ________________________________________________________________________________
    # Please file a bug in https://github.com/jeremyjh/dialyxir/issues with this message.
    #
    # Unknown error occurred: %FunctionClauseError{args: nil, arity: 1, clauses: nil, function: :format_long, kind: nil, module: Dialyxir.Warnings.OpaqueTypeTest}
    #
    #
    # Legacy warning:
    # lib/dialyzer_ets_error.ex:9: The type test is_reference('undefined' | ets:tid()) breaks the opacity of the term 'undefined' | ets:tid()

I think this is because of

    # `-opaque tid()         :: reference().`
    # in https://github.com/erlang/otp/blob/8e62b1781a8083301aae272162946414d9af4906/lib/stdlib/src/ets.erl#L57

A minimal demo project is here

Expected behavior

It should produce a clear warning

@Levin
Copy link

Levin commented Oct 2, 2024

ran into this as well :)

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

2 participants