Skip to content

Commit 91e76d3

Browse files
committed
Keep compatibility with modules from archives
1 parent 166c03d commit 91e76d3

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/elixir/lib/module/types/of.ex

-1
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,6 @@ defmodule Module.Types.Of do
930930
def format_diagnostic({:badapply, expr, args_types, domain, clauses, context}) do
931931
traces = collect_traces(expr, context)
932932
{{:., _, [mod, fun]}, _, args} = expr
933-
934933
{mod, fun, args, converter} = :elixir_rewrite.erl_to_ex(mod, fun, args)
935934

936935
%{

lib/elixir/src/elixir_erl.erl

+7-2
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,15 @@ compile(#{module := Module, anno := Anno} = Map) ->
141141
CheckerChunk = checker_chunk(Def, Defmacro, Map),
142142
load_form(Map, Prefix, Forms, TypeSpecs, DocsChunk ++ CheckerChunk).
143143

144-
dynamic_form(#{module := Module, anno := Anno, relative_file := RelativeFile,
144+
dynamic_form(#{module := Module, relative_file := RelativeFile,
145145
attributes := Attributes, definitions := Definitions, unreachable := Unreachable,
146146
deprecated := Deprecated, compile_opts := Opts} = Map) ->
147-
Line = erl_anno:line(Anno),
147+
%% TODO: Match on anno directly in Elixir v1.22+
148+
Line = case Map of
149+
#{anno := AnnoValue} -> erl_anno:line(AnnoValue);
150+
#{line := LineValue} -> LineValue
151+
end,
152+
148153
{Def, Defmacro, Macros, Exports, Functions} =
149154
split_definition(Definitions, Unreachable, Line, [], [], [], [], {[], []}),
150155

0 commit comments

Comments
 (0)