From df12d4b0e8fbb9f1ef045cc14151b194257aafaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sat, 9 Nov 2024 10:49:16 +0100 Subject: [PATCH] Fix more tests --- lib/elixir/lib/module/types.ex | 1 + lib/elixir/src/elixir_module.erl | 11 ++++++----- lib/mix/lib/mix/compilers/elixir.ex | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/elixir/lib/module/types.ex b/lib/elixir/lib/module/types.ex index 5257a784c0..5e606d53cc 100644 --- a/lib/elixir/lib/module/types.ex +++ b/lib/elixir/lib/module/types.ex @@ -30,6 +30,7 @@ defmodule Module.Types do end) # TODO: Reuse context from patterns and guards + # TODO: Fix logger errors {{fun, arity}, {:infer, Enum.reverse(pair_types)}} end end diff --git a/lib/elixir/src/elixir_module.erl b/lib/elixir/src/elixir_module.erl index bb7fe8b5df..95d737d5d5 100644 --- a/lib/elixir/src/elixir_module.erl +++ b/lib/elixir/src/elixir_module.erl @@ -167,6 +167,12 @@ compile(Meta, Module, ModuleAsCharlist, Block, Vars, Prune, E) -> [elixir_env:trace({remote_function, [], VerifyMod, VerifyFun, 1}, CallbackE) || {VerifyMod, VerifyFun} <- AfterVerify], + %% Compute signatures only if the module is valid. + case ets:member(DataSet, {elixir, taint}) of + true -> elixir_errors:compile_error(E); + false -> ok + end, + Signatures = case elixir_config:get(infer_signatures) of true -> 'Elixir.Module.Types':infer(Module, File, AllDefinitions, CallbackE); false -> #{} @@ -189,11 +195,6 @@ compile(Meta, Module, ModuleAsCharlist, Block, Vars, Prune, E) -> signatures => Signatures }, - case ets:member(DataSet, {elixir, taint}) of - true -> elixir_errors:compile_error(E); - false -> ok - end, - Binary = elixir_erl:compile(ModuleMap), Autoload = proplists:get_value(autoload, CompileOpts, true), spawn_parallel_checker(CheckerInfo, Module, ModuleMap), diff --git a/lib/mix/lib/mix/compilers/elixir.ex b/lib/mix/lib/mix/compilers/elixir.ex index 3d620b7659..bb222e0267 100644 --- a/lib/mix/lib/mix/compilers/elixir.ex +++ b/lib/mix/lib/mix/compilers/elixir.ex @@ -1,7 +1,7 @@ defmodule Mix.Compilers.Elixir do @moduledoc false - @manifest_vsn 25 + @manifest_vsn 26 @checkpoint_vsn 2 import Record