Skip to content

Run with no formatter set#558

Open
IslandUsurper wants to merge 3 commits intojeremyjh:masterfrom
IslandUsurper:default-formatter
Open

Run with no formatter set#558
IslandUsurper wants to merge 3 commits intojeremyjh:masterfrom
IslandUsurper:default-formatter

Conversation

@IslandUsurper
Copy link
Copy Markdown

When no formatter is specified, at least on OTP 26 and Elixir 1.16, calling mix dialyzer throws the following error

** (Protocol.UndefinedError) protocol Enumerable not implemented for nil of type Atom. This protocol is implemented for the following type(s): Date.Range, File.Stream, Function, GenEvent.Stream, HashDict, HashSet, IO.Stream, List, Map, MapSet, Range, Stream
    (elixir 1.16.3) lib/enum.ex:1: Enumerable.impl_for!/1
    (elixir 1.16.3) lib/enum.ex:166: Enumerable.reduce/3
    (elixir 1.16.3) lib/enum.ex:4396: Enum.map/2
    (dialyxir 1.4.3) lib/dialyxir/dialyzer.ex:35: Dialyxir.Dialyzer.Runner.run/2
    (dialyxir 1.4.3) lib/dialyxir/dialyzer.ex:96: Dialyxir.Dialyzer.dialyze/3
    (dialyxir 1.4.3) lib/mix/tasks/dialyzer.ex:274: Mix.Tasks.Dialyzer.run_dialyzer/2
    (dialyxir 1.4.3) lib/mix/tasks/dialyzer.ex:205: Mix.Tasks.Dialyzer.run/1
    (mix 1.16.3) lib/mix/task.ex:478: anonymous fn/3 in Mix.Task.run_task/5

Accessing maps with [] returns nil when the key isn't present, instead of the empty list, so this change should work for all supported versions.

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

Successfully merging this pull request may close these issues.

1 participant