Skip to content

Commit

Permalink
another attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Aug 20, 2024
1 parent 0477bf8 commit d7cc89d
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions test/elixir_sense/core/compiler_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ if true or Version.match?(System.version(), ">= 1.17.0-dev") do
else
Record.defrecordp(:elixir_ex,
caller: false,
prematch: if(Version.match?(System.version(), ">= 1.15.0-dev"), do: :raise, else: :warn),
prematch: %State{
prematch:
if Version.match?(System.version(), ">= 1.15.0-dev") do
Code.get_compiler_option(:on_undefined_variable)
else
:warn
end
},
stacktrace: false,
unused: {%{}, 0},
vars: {%{}, false}
Expand Down Expand Up @@ -73,7 +80,18 @@ if true or Version.match?(System.version(), ">= 1.17.0-dev") do
end

defp expand(ast) do
Compiler.expand(ast, %State{}, Compiler.env())
Compiler.expand(
ast,
%State{
prematch:
if Version.match?(System.version(), ">= 1.15.0-dev") do
Code.get_compiler_option(:on_undefined_variable)
else
:warn
end
},
Compiler.env()
)
end

defp elixir_expand(ast) do
Expand Down

0 comments on commit d7cc89d

Please sign in to comment.