This came up in issue #11204:
When emitting a warning for a type unification error,
the compiler overly simplifies the formatting of types
when these are maps or unions of maps.
To address this, we recursively check for maps inside
of a union type when comparing it to another map-like type.
- Support negative insertion indices
- Give a clear RuntimeError, rather than a baffling CondClauseError, when you ask for an insertion point that matches the last element of your range
This allows the formatter plugins to format content
based on whether it's a file or a sigil being formatted.
The modifiers could be used for additional options.
We also extend Mix.Tasks.Compiler.Diagnostic
to include {line, column} as possible position.
We also explicitly document the behaviour of
line=0, which is equivalent to unknown line.
Elixir was already setting the line to zero in
multiple occasions prior to this patch, so this
patch makes it official and we stop returning `nil`
for said cases.
This reverts commit 213cba2baa.
Including columns by default make Ecto test suite
consistently 10% slower and that's likely to replicate
across the board.
This changes the default for Code.string_to_quoted/2
and friends, so it may break tests matching explicitly
on the output, but the functionality wise the AST should
still be the same. The reason why it is important to make
this change is to provide better error messages throughout
Elixir.
This address the following case:
1. The user changes config/mix.exs/__mix_recompile__?
2. We detect the change, remove .beam files, and start recompilation
3. Recompilation fails for some reason
4. The user reverts the change
5. The compiler no longer recompiles (as it sees no change)
but the .beam files are now missing
To address this, we checkpoint all stale modules coming from config
and mix.exs changes, as well as all modules where __mix_recompile__?
returned true.