Skip to content

Commit

Permalink
fix crash on < 1.14
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Sep 27, 2024
1 parent 65f1798 commit fa78f3a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/elixir_sense/core/compiler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4792,9 +4792,15 @@ defmodule ElixirSense.Core.Compiler do
:elixir_rewrite.match_rewrite(receiver, dot_meta, right, meta, e_args)
end

defp do_rewrite(:guard, receiver, dot_meta, right, meta, e_args, s) do
# elixir uses guard context for error messages
:elixir_rewrite.guard_rewrite(receiver, dot_meta, right, meta, e_args, "guard")
if Version.match?(System.version(), "< 1.14.0") do
defp do_rewrite(:guard, receiver, dot_meta, right, meta, e_args, s) do
:elixir_rewrite.guard_rewrite(receiver, dot_meta, right, meta, e_args)
end
else
defp do_rewrite(:guard, receiver, dot_meta, right, meta, e_args, s) do

Check warning on line 4800 in lib/elixir_sense/core/compiler.ex

View workflow job for this annotation

GitHub Actions / mix test (Elixir 1.15.x | Erlang/OTP 24.x)

variable "s" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 4800 in lib/elixir_sense/core/compiler.ex

View workflow job for this annotation

GitHub Actions / mix test (Elixir 1.15.x | Erlang/OTP 25.x)

variable "s" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 4800 in lib/elixir_sense/core/compiler.ex

View workflow job for this annotation

GitHub Actions / mix test (Elixir 1.14.x | Erlang/OTP 24.x)

variable "s" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 4800 in lib/elixir_sense/core/compiler.ex

View workflow job for this annotation

GitHub Actions / mix test (Elixir 1.15.x | Erlang/OTP 26.x)

variable "s" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 4800 in lib/elixir_sense/core/compiler.ex

View workflow job for this annotation

GitHub Actions / mix test (Elixir 1.14.x | Erlang/OTP 26.x)

variable "s" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 4800 in lib/elixir_sense/core/compiler.ex

View workflow job for this annotation

GitHub Actions / mix test (Elixir 1.14.x | Erlang/OTP 25.x)

variable "s" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 4800 in lib/elixir_sense/core/compiler.ex

View workflow job for this annotation

GitHub Actions / mix test (Elixir 1.14.x | Erlang/OTP 23.x)

variable "s" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 4800 in lib/elixir_sense/core/compiler.ex

View workflow job for this annotation

GitHub Actions / mix test windows (Elixir 1.15.x | Erlang/OTP 24.x)

variable "s" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 4800 in lib/elixir_sense/core/compiler.ex

View workflow job for this annotation

GitHub Actions / mix test windows (Elixir 1.14.x | Erlang/OTP 24.x)

variable "s" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 4800 in lib/elixir_sense/core/compiler.ex

View workflow job for this annotation

GitHub Actions / mix test windows (Elixir 1.14.x | Erlang/OTP 25.x)

variable "s" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 4800 in lib/elixir_sense/core/compiler.ex

View workflow job for this annotation

GitHub Actions / mix test windows (Elixir 1.15.x | Erlang/OTP 26.x)

variable "s" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 4800 in lib/elixir_sense/core/compiler.ex

View workflow job for this annotation

GitHub Actions / mix test windows (Elixir 1.14.x | Erlang/OTP 23.x)

variable "s" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 4800 in lib/elixir_sense/core/compiler.ex

View workflow job for this annotation

GitHub Actions / mix test windows (Elixir 1.14.x | Erlang/OTP 26.x)

variable "s" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 4800 in lib/elixir_sense/core/compiler.ex

View workflow job for this annotation

GitHub Actions / mix test windows (Elixir 1.15.x | Erlang/OTP 25.x)

variable "s" is unused (if the variable is not meant to be used, prefix it with an underscore)
# elixir uses guard context for error messages
:elixir_rewrite.guard_rewrite(receiver, dot_meta, right, meta, e_args, "guard")
end
end

defp do_rewrite(_, receiver, dot_meta, right, meta, e_args, _s) do
Expand Down

0 comments on commit fa78f3a

Please sign in to comment.