Skip to content

Commit

Permalink
quick fix for hot code reload error
Browse files Browse the repository at this point in the history
Co-authored-by: @mayel
  • Loading branch information
msaraiva committed Oct 11, 2024
1 parent 0519ab0 commit 6c55707
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/mix/tasks/compile/surface.ex
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,14 @@ defmodule Mix.Tasks.Compile.Surface do
end
end

if Version.match?(System.version(), ">= 1.14.0") do
defp print_diagnostic(message, :warning, file, {line, col}) do
IO.warn(message, file: file, line: line, column: col)
end
end

# TODO: Remove this clause in Surface v0.13 and set required elixir to >= v1.14
defp print_diagnostic(message, :warning, file, line) do
# Use IO.warn(message, file: ..., line: ...) on Elixir v1.14+
rel_file = file |> Path.relative_to_cwd() |> to_charlist()
IO.warn(message, [{nil, :__FILE__, 1, [file: rel_file, line: line]}])
end
Expand Down

0 comments on commit 6c55707

Please sign in to comment.