Warning is the preferable solution for this, if we raise instead then it
is likely that there are some existing libraries that use duplicate
struct keys that will break.
Currently the callbacks on :elixir_compiler are called before the warnings of unused aliases and imports are emitted, causing the messages to not consumed during the compilation. This commit changes `:elixir_lexical.run/2` to `:elixir_lexical.run/3` splitting the callback in two, one during the execution to evaluate the forms and another to be called after all the warnings are emitted.
Fixes#9440
Dialyzer was giving this error:
> lib/calendar/iso.ex:672: Type specification 'Elixir.Calendar.ISO':year_of_era(year()) -> {year(),era::0..1} is a supertype of the success typing: 'Elixir.Calendar.ISO':year_of_era
(integer()) -> {pos_integer(), 0 | 1}
This fixes an edge case in which the compiler will process an
empty list value (`[]`) as a block with no clauses, which is not
possible.
Here is an example:
with {:ok, value} <- Map.fetch(%{a: 1}, :a) do
value
else
[]
end
With this change, the code above will not compile.
ExDoc is giving a warning since it has been deprecated and @doc is set to false.
> warning: documentation references Keyword.delete/3 but it doesn't exist or it's listed as @doc false (parsing Keyword docs)
[ci skip]
ExDoc was giving the following errors:
> lib/elixir/lib/string.ex:250: warning: Closing unclosed backquotes ` at end of input
> lib/elixir/lib/enum.ex:2319: warning: Closing unclosed backquotes ` at end of input
During bootstrap, the generated AST for the `defexception` macro
does not include import metadata when calling to Kernel functions
without using the qualified name. That's not the case when the
Kernel is later recompiled.
When compiling the standard library, exceptions like
`FunctionClauseError` were generating different ASTs (different
metadata) depending on if they were compiled with the bootstrapped
Kernel or the later compiled one.