jeremyjh / dialyxir

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

Failed to parse warning #462

Open frahugo opened 2 years ago

frahugo commented 2 years ago

Precheck

Environment

Current behavior

After upgrading puid package, dialyxir is having issues with the macro:

Please file a bug in https://github.com/jeremyjh/dialyxir/issues with this message.

Failed to parse warning:
[{:<, 1}, {:<, 1}, {:<, 1}, {:_, 1}, {:atom_part, 1, '@'}, {:int, 1, 5}, {:":", 1}, {:int, 1, 12}, {:",", 1}, {:_, 1}, {:atom_part, 1, '@'}, {:int, 1, 6}, {:":", 1}, {:int, 1, 12}, {:",", 1}, {:_, 1}, {:atom_part, 1, '@'}, {:int, 1, 7}, {:":", 1}, {:int, 1, 12}, {:",", 1}, {:_, 1}, {:atom_part, 1, '@'}, {:int, 1, 8}, {:":", 1}, {:int, 1, 12}, {:",", 1}, {:_, 1}, {:atom_part, 1, '@'}, {:int, 1, 9}, {:":", 1}, {:int, 1, 12}, {:",", 1}, {:_, 1}, {:atom_part, 1, '@'}, {:int, 1, 10}, {:":", 1}, {:int, 1, 12}, {:",", 1}, {:_, 1}, {:atom_part, 1, '@'}, {:int, 1, 11}, {:":", 1}, {:int, 1, 12}, {:",", 1}, {:_, 1}, {:atom_part, 1, '@'}, {:int, 1, ...}, {:":", ...}, {...}, ...]

Legacy warning:
lib/platform/access_code.ex:7: The pattern <<<_@5:12,_@6:12,_@7:12,_@8:12,_@9:12,_@10:12,_@11:12,_@12:12,_/binary-unit:1>>, _> can never match the type <<<>>,<<>>>
________________________________________________________________________________
Please file a bug in https://github.com/jeremyjh/dialyxir/issues with this message.

Failed to parse warning:
[{:<, 1}, {:<, 1}, {:_, 1}, {:atom_part, 1, '@'}, {:int, 1, 14}, {:":", 1}, {:int, 1, 6}, {:",", 1}, {:_, 1}, {:atom_part, 1, '@'}, {:int, 1, 15}, {:":", 1}, {:int, 1, 6}, {:",", 1}, {:_, 1}, {:atom_part, 1, '@'}, {:int, 1, 16}, {:":", 1}, {:int, 1, 6}, {:",", 1}, {:_, 1}, {:atom_part, 1, '@'}, {:int, 1, 17}, {:":", 1}, {:int, 1, 6}, {:",", 1}, {:_, 1}, {:atom_part, 1, '@'}, {:int, 1, 18}, {:":", 1}, {:int, 1, 6}, {:",", 1}, {:_, 1}, {:atom_part, 1, '@'}, {:int, 1, 19}, {:":", 1}, {:int, 1, 6}, {:",", 1}, {:_, 1}, {:atom_part, 1, '@'}, {:int, 1, 20}, {:":", 1}, {:int, 1, 6}, {:",", 1}, {:_, 1}, {:atom_part, 1, '@'}, {:int, 1, 21}, {:":", 1}, {:int, ...}, {...}, ...]

Legacy warning:
lib/platform/access_code.ex:7: The pattern <<_@14:6,_@15:6,_@16:6,_@17:6,_@18:6,_@19:6,_@20:6,_@21:6>> can never match the type <<>>

This is the module using the macro from puid:

defmodule Platform.AccessCode do
  @moduledoc """
  doc 
  removed
  """

  use Puid, bits: 32, chars: "ABCDEFGHJKMNPQRSTWYZabcdefghijkmnpqrstwyz23456789"
end

Expected behavior

Parse source code.

tomtaylor commented 1 year ago

Can we help move this forward at all? We use Dialyxir as part of our CI workflow and we can't upgrade Puid because of this issue.

jeremyjh commented 1 year ago

PRs are always welcome. Most likely this needs to be fixed in erlex.