Projects like Plug use require to establish compile
time dependencies inside a Plug. The fact require
only added a compile-time dependency in v1.13.0 was
therefore a regression, addressed by this commit.
Before this fix, evaluating `b = a` with assignments of: `a: 1, a: 2, c:
3` would eval AST equivalent to `^c = a`. This happened due to binding
normalization generating version numbers larger than the total number of
bindings. Later in the pipeline, the number of bindings is used to
compute the next version number, which would then conflict with an
existing binding.
This commit fixes that by not increasing the version number when
a repeated binding is normalized.
The following code would crash:
iex> Code.quoted_to_algebra(Elixir)
** (MatchError) no match of right hand side value: "Elixir"
(elixir 1.13.1) lib/code/normalizer.ex:254: Code.Normalizer.normalize_literal/3
(elixir 1.13.1) lib/code.ex:1107: Code.quoted_to_algebra/2
Therefore, this as well:
iex> Macro.to_string(Elixir)
** (MatchError) no match of right hand side value: "Elixir"
(elixir 1.13.1) lib/code/normalizer.ex:254: Code.Normalizer.normalize_literal/3
(elixir 1.13.1) lib/code.ex:1107: Code.quoted_to_algebra/2
(elixir 1.13.1) lib/macro.ex:948: Macro.to_string/1
* Use specific options for base option typespecs
Each function had `keyword` as the option type, which didn't help guard
against typos or mismatched options.
* Fix padding use in encode/decode identity test
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.