From d7cc89daee15f1663123009937ce6ec336ae08d7 Mon Sep 17 00:00:00 2001 From: Lukasz Samson Date: Tue, 20 Aug 2024 18:39:32 +0200 Subject: [PATCH] another attempt --- test/elixir_sense/core/compiler_test.exs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/test/elixir_sense/core/compiler_test.exs b/test/elixir_sense/core/compiler_test.exs index 4ea6c295..e5e1c9d0 100644 --- a/test/elixir_sense/core/compiler_test.exs +++ b/test/elixir_sense/core/compiler_test.exs @@ -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} @@ -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