Skip to content

ParallelChecker fails to compile module in compile-time #12263

@hissssst

Description

@hissssst

Elixir and Erlang/OTP versions

Erlang/OTP 24 [erts-12.3.2.5] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]

Elixir 1.14.1 (compiled with Erlang/OTP 24)

Operating system

linux

Current behavior

$ cat bug.ex
defmodule Bug do

  quote do
    defmodule X do
      def f() do
        x = %{}
        %{x | key: :value}
      end
    end
  end
  |> Code.compile_quoted()

end
$ elixir bug.ex
** (EXIT from #PID<0.94.0>) an exception was raised:
    ** (ArgumentError) errors were found at the given arguments:

  * 1st argument: not an integer

        :erlang.integer_to_binary(nil)
        (elixir 1.14.1) lib/module/parallel_checker.ex:308: Module.ParallelChecker.format_file_line/2
        (elixir 1.14.1) lib/module/parallel_checker.ex:295: Module.ParallelChecker.format_location/1
        (elixir 1.14.1) lib/module/parallel_checker.ex:274: anonymous fn/1 in Module.ParallelChecker.emit_warnings/1
        (elixir 1.14.1) lib/enum.ex:4249: Enum.flat_map_list/2
        (elixir 1.14.1) lib/module/parallel_checker.ex:235: Module.ParallelChecker.check_module/2
        (elixir 1.14.1) lib/module/parallel_checker.ex:78: anonymous fn/5 in Module.ParallelChecker.spawn/3

Expected behavior

Doesn't raise, module is compiled successfully

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions