Commit Graph
213 Commits
Author SHA1 Message Date
José Valim e86a91aae3 Use macros instead of special casing in the compiler 2020-07-01 15:49:14 +02:00
José Valim bb808fe683 Add line numbers to deprecated imports 2020-06-11 15:59:07 +02:00
José Valim 9ce3f7d816 Force modules to be loaded when they are required 2020-04-26 11:03:30 +02:00
José Valim f21f9af667 Rewrite and deprecate System.stacktrace 2020-02-24 21:31:37 +01:00
José Valim b2d58e5f35 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 9fca33e09f Cleanup TODOs for OTP 21+ (#9477) 2019-11-03 13:05:18 +01:00
José Valim cf881389cf Remove unecessary Erlang macro 2019-11-01 19:19:54 +01:00
José Valim 9790329a08 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 772c078651 Remove dispatch tracking in LexicalTracker (#9228) 2019-07-18 13:48:02 +02:00
Eric Meadows-Jönsson a3c3bc0f69 Add ExCk chunk (#9203) 2019-07-09 21:23:38 +02:00
Eric Meadows-Jönsson ade3664a3a Move deprecation check to group pass (#9176) 2019-07-03 09:56:35 +02:00
José Valim e80b55b21c Unify error handling and compiler deadlock checking (#9009) 2019-05-02 16:27:13 +02:00
Fernando Tapia Rico 03b7d6cdfa Raise if a macro is invoked before its definition (#8822) 2019-02-25 22:48:21 +01:00
José Valim 64eb6af13a Rely on IO.warn whenever possible 2019-01-18 14:59:20 +01:00
José Valim 6a69616dd1 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 5b48933f47 Let the undefined function error be performed in Elixir-land (#8231)
Refers to #5800
2018-10-01 12:22:38 +02:00
José Valim 4ddb7cbded Correctly tag struct invocations, closes #8097 2018-08-16 23:56:47 +02:00
Michał Muskała f9eec35a00 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 ddaf27116a 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 86b7197c8a.
2018-08-04 12:29:03 +02:00
Michał Muskała 25aede7984 Fix all compiler warnings (#7992) 2018-07-27 16:42:24 +02:00
Michał Muskała 86b7197c8a 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 276a4783f4 Inline construction of remote erlang calls in compiler 2018-07-25 00:10:02 +02:00
José Valim 2058ade2f6 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 2fabeb60c2 Move stdlib deprecations to @deprecated attribute (#7637) 2018-05-03 20:31:34 +02:00
José Valim 3e21ae75e3 Deprecate outdated Registry.start_link/2 2018-02-12 10:48:00 +01:00
José Valim a7eea90d05 Bring add_doc/6 back, closes #7335 2018-02-10 11:07:19 +01:00
Andrea Leopardi 56b81ffc4d Hard-deprecate some things for 1.7 (#7139) 2017-12-24 21:32:56 +01:00
José Valim 115bb08f51 Deprecate Range.range? in favor of pattern matching 2017-10-17 19:54:03 +02:00
José Valim e0884748f7 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 d24cad38fb Add Code.Identifier to hold shared identifier logic throughout Elixir 2017-08-22 13:22:26 +02:00
José Valim 491a5f2b8c Start v1.6.0-dev 2017-06-25 13:49:50 +02:00
José Valim 29d0d0b0c2 Deprecate Enum.filter_map/Stream.filter_map 2017-05-28 17:06:58 +02:00
Eksperimental dde1f999db Sort deprecation clauses alphabetically in :elixir_dispatch (#6135) 2017-05-23 10:01:07 +02:00
José Valim df1b084508 Add Exception.blame/3 and Exception.blame_mfa/3 (#6127) 2017-05-22 23:58:14 +02:00
Eksperimental 28c6638f82 Deprecation of "strip" functions in String module (#6128) 2017-05-22 10:48:01 +02:00
Michał Muskała d8d412cbf2 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 1e43701f39 Restore (deprecated) Integer.to_char_list/2 (#5928) 2017-03-25 14:05:54 +01:00
Aleksei Magusev 30ba2c8527 Rename elixir_exp module to elixir_expand 2017-02-19 21:57:50 +01:00
Aleksei Magusev c1c009537a Rename m/2 helper macro to key/2 in the main header file 2017-02-19 21:56:05 +01:00
José Valim f9d46d9145 Split erl and ex passes in elixir_def 2017-02-19 13:01:13 +01:00
José Valim b3a75a079f Unify local handling in elixir_def 2017-02-18 23:36:30 +01:00
José Valim 71d37fbed5 Move case inlining out of Elixir pass 2017-02-16 18:24:25 +01:00
Andrea Leopardi b483ece89c Hard deprecate GenEvent and provide alternatives in its docs (#5705) 2017-01-26 23:56:41 +01:00
Andrea Leopardi 9d621ffbbc Fix a deprecation in elixir_dispatch 2016-12-03 17:51:19 +01:00
Andrea Leopardi 45a34f409f Move a bunch of hard deprecations to elixir_dispatch (#5524) 2016-12-03 17:23:58 +01:00
Andrea Leopardi 096f5693db Hard-deprecate the "char_list" spelling (#5517) 2016-12-01 21:51:47 +01:00
Andrea Leopardi 3b5d027a83 Deprecate String.rjust/2,3 and String.ljust/2,3 (#5516) 2016-12-01 12:59:43 +01:00
Andrea Leopardi a75452eb91 Hard-deprecate the Set module (#5513)
It will be removed in Elixir 2.0.
2016-12-01 10:28:09 +01:00
Andrea Leopardi 91e217ff10 Hard-deprecate String.*strip/1,2 functions (#5508) 2016-12-01 10:16:49 +01:00
José Valim f93a34eeef Emit compilation warnings for HashDict, HashSet and Dict 2016-07-23 12:31:12 +02:00