jeremyjh / dialyxir

Mix tasks to simplify use of Dialyzer in Elixir projects.
Apache License 2.0
1.69k stars 141 forks source link

Unknown error occurred: %Protocol.UndefinedError{description: "", protocol: String.Chars, value: {33, 9}} #458

Closed alexdesousa closed 8 months ago

alexdesousa commented 2 years ago

Precheck

Environment

Erlang/OTP 26 [erts-14.1.1] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]

Interactive Elixir (1.15.7) - press Ctrl+C to exit (type h() ENTER for help)
"dialyxir": {:hex, :dialyxir, "1.4.2", "764a6e8e7a354f0ba95d58418178d486065ead1f69ad89782817c296d0d746a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "516603d8067b2fd585319e4b13d3674ad4f314a5902ba8130cd97dc902ce6bbd"},

Current behavior

I was checking similar errors and though I think #435 might be related to this error I'm not exactly certain. When using dialyzer with my project AyeSQL I get these errors:

Click to expand errors ``` $ mix dialyzer ... compilation ... Compiling 3 files (.ex) Finding suitable PLTs Checking PLT... [:asn1, :ayesql, :compiler, :crypto, :db_connection, :decimal, :ecto, :ecto_sql, :eex, :elixir, :jason, :kernel, :logger, :postgrex, :public_key, :ssl, :stdlib, :telemetry] PLT is up to date! No :ignore_warnings opt specified in mix.exs and default does not exist. Starting Dialyzer [ check_plt: false, init_plt: ~c"/home/alex/Projects/open-source/ayesql/priv/plts/ayesql.plt", files: [~c"/home/alex/Projects/open-source/ayesql/_build/dev/lib/ayesql/ebin/Elixir.AyeSQL.AST.Context.beam", ~c"/home/alex/Projects/open-source/ayesql/_build/dev/lib/ayesql/ebin/Elixir.AyeSQL.AST.beam", ~c"/home/alex/Projects/open-source/ayesql/_build/dev/lib/ayesql/ebin/Elixir.AyeSQL.CompileError.beam", ~c"/home/alex/Projects/open-source/ayesql/_build/dev/lib/ayesql/ebin/Elixir.AyeSQL.Compiler.beam", ~c"/home/alex/Projects/open-source/ayesql/_build/dev/lib/ayesql/ebin/Elixir.AyeSQL.Core.beam", ...], warnings: [:unknown] ] Total errors: 4, Skipped: 0, Unnecessary Skips: 0 done in 0m2.67s Please file a bug in https://github.com/jeremyjh/dialyxir/issues with this message. Unknown error occurred: %Protocol.UndefinedError{protocol: String.Chars, value: {41, 9}, description: ""} Legacy warning: /home/alex/.asdf/installs/erlang/26.1.2/lib/parsetools-2.5/include/leexinc.hrl:41:9: The pattern {A, Alen, Ics1, L1, _C1} can never match the type {0 | 1 | 2 | 3 | 4,_,_,_,_,1..255} | {_,_,_,_,_,_,_} ________________________________________________________________________________ Please file a bug in https://github.com/jeremyjh/dialyxir/issues with this message. Unknown error occurred: %Protocol.UndefinedError{protocol: String.Chars, value: {114, 9}, description: ""} Legacy warning: /home/alex/.asdf/installs/erlang/26.1.2/lib/parsetools-2.5/include/leexinc.hrl:114:9: The pattern {A1, Alen1, Ics1, L1, C1} can never match the type {0 | 1 | 2 | 3 | 4,_,_,_,_,1..255} | {_,_,_,_,_,_,_} ________________________________________________________________________________ Please file a bug in https://github.com/jeremyjh/dialyxir/issues with this message. Unknown error occurred: %Protocol.UndefinedError{protocol: String.Chars, value: {204, 9}, description: ""} Legacy warning: /home/alex/.asdf/installs/erlang/26.1.2/lib/parsetools-2.5/include/leexinc.hrl:204:9: The pattern {A1, Alen1, Ics1, L1, C1} can never match the type {0 | 1 | 2 | 3 | 4,_,_,_,_,1..255} | {_,_,_,_,_,_,_} ________________________________________________________________________________ Please file a bug in https://github.com/jeremyjh/dialyxir/issues with this message. Unknown error occurred: %Protocol.UndefinedError{protocol: String.Chars, value: {274, 9}, description: ""} Legacy warning: /home/alex/.asdf/installs/erlang/26.1.2/lib/parsetools-2.5/include/leexinc.hrl:274:9: The pattern {A1, Alen1, Ics1, L1, C1} can never match the type {0 | 1 | 2 | 3 | 4,_,_,_,_,1..255} | {_,_,_,_,_,_,_} ________________________________________________________________________________ done (warnings were emitted) Halting VM with exit status 2 ```

I thought they were related to the lexer, so I decided to ignore the files using .dialyzer_ignore.exs file (but it didn't work :grimacing:):

# File: .dialyzer_ignore.exs
[
    {"src/ayesql_lexer.xrl"},
    {"src/ayesql_lexer.erl"},
    {"src/ayesql_parser.yrl"},
    {"src/ayesql_parser.erl"}
]

Note: The repo does not have a .dialyzer_ignore.exs file at the moment.

Expected behavior

Not seeing these errors :grimacing:

alexdesousa commented 9 months ago

I updated all the information in the issue description.