This makes it so we're always capturing delimiter metadata for sigils
instead of requiring the `token_metadata` option. This means that we can
now show the correct sigils in ExUnit diffs (and elsewhere) for code
examples.
We have recently changed the compiler to emit a warning
for each undefined function with a generic error at the
end saying the module could not be defined.
Unfortunately, some tools like IDEs and Phoenix Reloader
give higher priority to errors over warnings, which means
an error would be shown but without any actionable
information.
This commit changes it so the first undefined function is
an error and all following ones are warnings.
Before:
iex(1)> a = [flatten: 1]; import List, only: a
** (CaseClauseError) no case clause matching: {:only, {:a, [version: 0, line: 1], nil}}
(elixir 1.10.0-dev) src/elixir_import.erl:10: :elixir_import.import/4
After:
iex(1)> a = [flatten: 1]; import List, only: a
** (CompileError) iex:1: invalid :only option for import, expected value to be an atom :functions, :macros, or a list literal, got: a
(elixir 1.10.0-dev) src/elixir_import.erl:22: :elixir_import.import/4
We seem to use "pattern" to describe the thing that is doing the
matching, and "match" to describe the _found_ object. This is intended
to make this docs more consistent with the language found in the `Regex`
module.
Fixes#9659
Mix stores the compile_env in each applications' .app file.
Releases and Mix tasks were also changed to validate against
the runtime configuration against any stored `compile_env`.
In case of mismatches, an error is raised during boot.
In the optimized case with a single-element list returned from the
`next_fun`, call the stream function chain in a separate try/catch
block. If it errors out, call the `after_fun` with the new accumulator
returned from `next_fun`.
Previously the `after_fun` was called with the old accumulator in such
case.
Sometimes one undefined function warning can hide others.
For example, in a function call like this:
foo(bar 1, 2)
The user may be expecting it to be called as:
foo(bar(1), 2)
But Elixir compiles it to:
foo(bar(1, 2))
In this case, the warning would be one of "undefined
function foo/1" or "undefined function bar/2", but they
are only "half truths". By showing all undefined function
warnings, we improve errors like above and it allows
users to see all undefined calls at once, when it would
otherwise require them to compile the code multiple times.