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.
This feature allows IDEs and other tools wanting to
perform source code analysis to do so reliably without
a need to reimplement Elixir's compiler expansion and
without relying on Elixir's private APIs.
This commit also adds :parser_options to compiler
options, which allows developers to combine both options
to retrieve more accurate information, such as columns.
Unfortunately it is common to have macros that invokes macros
from other modules, leading to mixed quoted expressions causing
the counters to be mixed.
We would need to scope the counters to the caller.
This reverts commit 86b7197c8a.
When the module is being compiled, we use deterministic counters instead
of random ones. This should help with most cases of undeterministic
source code or .beam files.
Closes#7955
Erlang/OTP 20 warns if the stacktrace is read outside of a
catch/rescue. This commit mirrors this behaviour by consistently
warning on `System.stacktrace/0` being used outside of a
catch/rescue.
Erlang/OTP 21 warns whenever System.stacktrace/:erlang.get_stacktrace
are used. Therefore we need to promote the usage of `__STACKTRACE__`
and make sure to conditionally compile it according to the OTP version.
This requires changes to the Exception normalization mechanism
so we compute `__STACKTRACE__` only when strictly required.
In future Elixir releases, `System.stacktrace/0` will warn when
used even inside catch/rescue.
`replace!` was introduced to mirror `update!` but without the
anonymous function. Given there is no `update`, we should not
introduce a `replace` until we are sure of the semantics we
want for update.