Commit Graph
916 Commits
Author SHA1 Message Date
Michał Muskała 77c9d4872d Use contextual vars for __CALLER__ (#7309) 2018-02-03 23:10:40 -02:00
Michał Muskała 097de7d308 Introduce __STACKTRACE__ (#7134) 2018-02-03 14:09:47 -02:00
José Valim 84dcbbb4d1 Revert "Do not change argument evaluation semantics in bind_quoted (#7298)"
This reverts commit 7c142fbc86.

This causes a build failure on Erlang 19.
2018-02-03 10:57:40 -02:00
José Valim 7c142fbc86 Do not change argument evaluation semantics in bind_quoted (#7298) 2018-02-01 14:08:47 -02:00
José Valim d8a57371d4 Properly format warning_test.exs 2018-02-01 14:08:10 -02:00
José Valim 83c2791263 Do not change code invocation semantics in guards 2018-02-01 11:38:09 -02:00
José Valim 1d0ac1caac Do not warn for underscored var access from quoted contexts 2018-02-01 11:02:04 -02:00
Wojtek Mach d58b315d94 Improve struct comparison warning (#7284) 2018-01-30 22:03:06 -02:00
Michał Muskała 4ef61b81c2 Warn about comparison with calendar structs (#7274) 2018-01-30 11:41:43 -02:00
José Valim 4b134c8cf5 Raise on invalid map syntax, closes #7268 2018-01-28 11:04:25 -02:00
José Valim 00c7a3bc60 Merge binaries and bitstrings when possible 2018-01-25 15:40:44 -02:00
José Valim 8a23ec182c Do not expose current_vars, provide proper APIs in Macro.Env 2018-01-23 10:02:00 +01:00
José Valim 9ef646eed5 Support bitstrings in Collectable
Closes #7234
2018-01-21 13:25:11 +01:00
José Valim 219c6cc867 Move unused_vars check to Elixir land
This gives us better control over when and how unused variables are printed.

As a result, we are able to emit unused variable warnings in situations
we could not before. This also opens up the way for us to remove a
dependency on erl_lint and track types information, which allows us to
speed up compilation times about 5% and allow us to emit more performant
code in some situations.
2018-01-20 19:45:48 +01:00
José Valim f99bb7c0e5 Process variable versioning on Elixir pass 2018-01-20 19:42:08 +01:00
José Valim 113d2c69c9 Remove export_vars from Macro.Env 2018-01-20 19:42:08 +01:00
José Valim c38fa49a74 Improve undefined behaviour warning 2018-01-19 12:01:21 +01:00
José Valim 4175ddebd9 Do not allow stabs mixed with expressions 2018-01-16 12:23:12 +01:00
José Valim 684397f59c Normalize built-in attributes error messages 2018-01-12 21:01:44 +01:00
José Valim f34d74913c Warn if heredoc is outdented, closes #7174 2018-01-07 17:46:42 +01:00
José Valim c270e7211f Remove deprecation warnings 2017-12-26 23:18:18 +01:00
José Valim 9e232a60a1 Store expanded expressions in defguard, closes #7147 2017-12-26 00:06:28 +01:00
José Valim 112ffc65f8 Ensure no dialyzer warnings after protocol consolidation, closes #7107 2017-12-22 12:36:24 +01:00
Glauber Campinho 1d58413053 Introduce @deprecated (#7113) 2017-12-19 11:44:35 +01:00
Glauber Campinho b99306bb44 Remove multiple clauses warning for default values on bodiless clause (#7092) 2017-12-11 21:38:49 +01:00
José Valim b4aac2d7be Do not indent right-side of pipelines in the formatter (#7103) 2017-12-11 21:07:30 +01:00
José Valim 4d3cbcdaaa Introduce @since as non-warning definition annotation
Partially implements #7099.
2017-12-11 18:22:08 +01:00
Glauber Campinho e12a76eca9 Translate clauses for boolean check (#7069)
Warnings for unsafe variable on boolean checks stopped working after #7015 because
variables of the right clause are unbound on the left clause.

Fixes #7044
2017-11-28 11:56:13 -02:00
jgmchan 882c2bdb24 Show better error if an anonymous function has default arguments 2017-11-16 13:53:28 -02:00
Glauber Campinho 9aeafeefbd Warn duplicate definitions in macros (#7037)
Closes #6637
2017-11-15 20:52:28 +01:00
Glauber Campinho eb0891b94b Fix @impl warnings with default arguments (#7028) 2017-11-15 12:04:23 +01:00
Glauber Campinho 505c10e474 Support uniq: true in for comprehensions (#7020) 2017-11-13 23:00:53 +01:00
José Valim 432e9114b1 Ensure we track behaviours at compile time 2017-11-09 22:13:58 +01:00
José Valim ad190b0889 Raise on reserved tokens, closes #6532 2017-11-06 17:15:44 +01:00
Chris Keele 6ab811c638 Adds Kernel.defguard/1 macro to build guard-safe macros
This makes defining guards easier, since it does the boilerplate
for you and raises at compile time in the defguard macro when
you do something not allowed in guards (as opposed to whenever
the new guard happens to be used as a guard).

It takes a `defguard name(args) when implementation` invocation,
passes the implementation through `:elixir_expand.expand/2` in
a guard context, and if nothing is raised, transforms the impl
into a macro that works both inside and outside of guard contexts.

Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2017-11-06 12:39:53 +01:00
José Valim 74da11fd91 Ensure we handle :undefined returns for optional callbacks, closes #6993 2017-11-01 20:27:41 +01:00
José Valim 6ea055cd61 Track structs separately from compile time deps, closes #6575 2017-11-01 17:44:12 +01:00
José Valim bf26e78c18 Remove test marked with @tag :skip
The test is implemented in typespec_tesst as an error.
2017-10-31 14:26:30 +01:00
Michał Muskała c95a877d38 Separate tracking structs from compile-time dependencies
This is a first step to limiting recompilations in case a struct is used in a
module, the "parent module" of the struct changes, but struct definition itself
does not change.

Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2017-10-31 14:24:48 +01:00
José Valim 794928efe1 Restrict next break fits and eols on operators and function calls
* Whitelist which operators support next_break_fits
  * No longer consider tuples as part of next_break_fits
  * Do not consider eol for = and ::
  * Do not consider eol for calls with one next_break_fits arg
2017-10-27 12:34:09 +02:00
José Valim 4b930b0a0b Avoid conflicts with erl_anno in meta
We avoid using :file publicly as well as :location privately.
We do still use :file privately but that's supposed to mirror
the `-file` annotation in Erlang before function definitions.
2017-10-25 00:33:05 +02:00
José Valim ef3494ae68 Improve optional callback checks 2017-10-22 01:48:00 +02:00
José Valim 41bc3616d9 Move all remaining behaviour usage warnings to Elixir 2017-10-22 00:59:11 +02:00
Alexis Brodeur 0194bad846 Perform some behaviour lint checks in Elixir (#6841) 2017-10-21 23:35:15 +02:00
José Valim 255927fcc8 Format expansion_test.exs 2017-10-21 20:56:13 +02:00
José Valim eacd2d4780 Improve warnings during expansion 2017-10-21 20:43:35 +02:00
Glauber Campinho 82864d106b Add file information to the dispatches on the source manifests (#6954) 2017-10-21 11:53:06 +02:00
Pedro Medeiros 53a7883378 Format @spec with map literal with multi keys
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2017-10-19 18:32:04 +02:00
José Valim f7dede6e8d Simplify rules for & with binary operators
Closes #6923.
2017-10-16 18:10:56 +02:00
José Valim 796eacfe98 Check files are formatted on CI 2017-10-12 09:41:06 +02:00