Commit Graph
220 Commits
Author SHA1 Message Date
José Valim 6159b4e841 Warn if Application.compile_env is called without a require 2021-08-22 17:11:41 +02:00
José Valim a3b12428f9 Let runtime pass check for unrequired macros 2021-08-08 21:19:02 +02:00
José Valim 739ad53fed Break Macro.Env apart (#11164)
Previously, the internal Elixir expansion pass worked directly on
Macro.Env. However, this poised an issue, if we want to track
more information in the pass, we ended up exposing it on
Macro.Env, making it larger, and potentially slowing down
operations such as __ENV__ serialization.

This commit refactors the expansion pass to work with two
structures, the Macro.Env struct and a #elixir_ex{} record.
2021-08-03 13:35:15 +02:00
José Valim dac03b17c2 Ensure deprecated macros emit warnings 2021-06-23 22:15:34 +02:00
José Valim 0a262ba86f Do not hide deadlocks between imports and structs, closes #10800 2021-03-16 17:47:53 +01:00
José Valim 6320ee7953 Fix unused variable warning 2020-11-03 20:43:05 +01:00
José Valim 648ee98794 Deprecate System.stacktrace/0 across the language 2020-11-03 20:28:52 +01:00
José Valim 089d0cd6b6 Use macros instead of special casing in the compiler 2020-07-01 15:49:14 +02:00
José Valim cc138f37f2 Add line numbers to deprecated imports 2020-06-11 15:59:07 +02:00
José Valim 3fe3accc05 Force modules to be loaded when they are required 2020-04-26 11:03:30 +02:00
José Valim 3c9e004ded Rewrite and deprecate System.stacktrace 2020-02-24 21:31:37 +01:00
José Valim ba619b1c3e Add Application.compile_env/3 (#9628)
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.
2019-12-06 17:23:01 +01:00
Łukasz Jan Niemier 2c8e75c3d3 Cleanup TODOs for OTP 21+ (#9477) 2019-11-03 13:05:18 +01:00
José Valim afa860ab4a Remove unecessary Erlang macro 2019-11-01 19:19:54 +01:00
José Valim b08593b9d1 Add compiler tracing (#9247)
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.
2019-08-02 13:35:12 +02:00
Eric Meadows-Jönsson 1956e95808 Remove dispatch tracking in LexicalTracker (#9228) 2019-07-18 13:48:02 +02:00
Eric Meadows-Jönsson f418ed247c Add ExCk chunk (#9203) 2019-07-09 21:23:38 +02:00
Eric Meadows-Jönsson f88676db9b Move deprecation check to group pass (#9176) 2019-07-03 09:56:35 +02:00
José Valim 59fcce0b92 Unify error handling and compiler deadlock checking (#9009) 2019-05-02 16:27:13 +02:00
Fernando Tapia Rico 0a81b27861 Raise if a macro is invoked before its definition (#8822) 2019-02-25 22:48:21 +01:00
José Valim 0ce62a2add Rely on IO.warn whenever possible 2019-01-18 14:59:20 +01:00
José Valim d85ed42765 Update removal and deprecation annotations
In particular, all deprecated code would be removed on v2.0,
so we don't need to annotate dperecated code with a TODO to
remove it on v2.0.
2018-12-21 13:27:06 +01:00
Glauber Campinho 741dfda9f4 Let the undefined function error be performed in Elixir-land (#8231)
Refers to #5800
2018-10-01 12:22:38 +02:00
José Valim 36718cb41b Correctly tag struct invocations, closes #8097 2018-08-16 23:56:47 +02:00
Michał Muskała d76f150274 Use scoped deterministic counters in AST expansion
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2018-08-04 12:56:01 +02:00
José Valim f2415dd06c Revert "Use deterministic counters in AST expansion"
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 f04f46c49d.
2018-08-04 12:29:03 +02:00
Michał Muskała ffb931a5ac Fix all compiler warnings (#7992) 2018-07-27 16:42:24 +02:00
Michał Muskała f04f46c49d Use deterministic counters in AST expansion
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
2018-07-25 00:10:02 +02:00
Michał Muskała 4229536799 Inline construction of remote erlang calls in compiler 2018-07-25 00:10:02 +02:00
José Valim 75541cf472 Condititionally compile and lazily compute __STACKTRACE__ (#7648)
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.
2018-05-07 15:33:36 +02:00
José Valim 11a0b39ad4 Move stdlib deprecations to @deprecated attribute (#7637) 2018-05-03 20:31:34 +02:00
José Valim f416a685fb Deprecate outdated Registry.start_link/2 2018-02-12 10:48:00 +01:00
José Valim b8bf33beff Bring add_doc/6 back, closes #7335 2018-02-10 11:07:19 +01:00
Andrea Leopardi 48e914dd3a Hard-deprecate some things for 1.7 (#7139) 2017-12-24 21:32:56 +01:00
José Valim ed98604dc3 Deprecate Range.range? in favor of pattern matching 2017-10-17 19:54:03 +02:00
José Valim a81a17b3b0 Deprecate Keyword.replace/3 and Map.replace/3
`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.
2017-10-04 13:43:07 +02:00
José Valim 0b0ab9f8ef Add Code.Identifier to hold shared identifier logic throughout Elixir 2017-08-22 13:22:26 +02:00
José Valim 43a4720b1a Start v1.6.0-dev 2017-06-25 13:49:50 +02:00
José Valim 978b8450df Deprecate Enum.filter_map/Stream.filter_map 2017-05-28 17:06:58 +02:00
Eksperimental ad167e2e95 Sort deprecation clauses alphabetically in :elixir_dispatch (#6135) 2017-05-23 10:01:07 +02:00
José Valim 07d40af48f Add Exception.blame/3 and Exception.blame_mfa/3 (#6127) 2017-05-22 23:58:14 +02:00
Eksperimental c8d6fb0054 Deprecation of "strip" functions in String module (#6128) 2017-05-22 10:48:01 +02:00
Michał Muskała 170019c869 Make sure System.stracktrace is first thing done in the handler (#6119)
If any of the functions catches an error, we'd get a wrong trace
2017-05-18 12:27:17 +02:00
Jeff Kreeftmeijer efa05882d0 Restore (deprecated) Integer.to_char_list/2 (#5928) 2017-03-25 14:05:54 +01:00
Aleksei Magusev 84b67b5b95 Rename elixir_exp module to elixir_expand 2017-02-19 21:57:50 +01:00
Aleksei Magusev a729847db6 Rename m/2 helper macro to key/2 in the main header file 2017-02-19 21:56:05 +01:00
José Valim 8e2ebf739b Split erl and ex passes in elixir_def 2017-02-19 13:01:13 +01:00
José Valim ff3fc7ef43 Unify local handling in elixir_def 2017-02-18 23:36:30 +01:00
José Valim 152cf2616b Move case inlining out of Elixir pass 2017-02-16 18:24:25 +01:00
Andrea Leopardi b6e1beb9b3 Hard deprecate GenEvent and provide alternatives in its docs (#5705) 2017-01-26 23:56:41 +01:00