Commit Graph
1260 Commits
Author SHA1 Message Date
José Valim d8adc34e68 Add a TODO to variable warnings 2016-10-04 14:19:25 +02:00
Aleksei Magusev 8eae1166fd Consider is_process_alive/1 calls in returns_boolean/1 check 2016-09-28 13:19:26 +02:00
Aleksei Magusev 79a72ae26c Consider is_record/1,2,3 calls in returns_boolean/1 check 2016-09-28 13:08:45 +02:00
Aleksei Magusev 4e681d5fcb Consider is_map/1 calls in returns_boolean/1 check 2016-09-28 12:49:49 +02:00
José Valim 89adb42b58 Update return boolean check for orelse/andalso 2016-09-28 10:30:48 +02:00
José Valim 819d81c28e Do not build matches if variables are the same 2016-09-27 18:24:34 +02:00
José Valim 8e2a1e5851 Remove Kernel.rand/0 and Kernel.rand/1
Since Enum.random/1 already provides the Kernel.rand/1
functionality.
2016-09-21 23:39:33 +02:00
Andrea Leopardi dd78780363 Fix a few typos introduced in 904e89782d 2016-09-21 11:11:16 +02:00
Steven Blowers 904e89782d Fixing spelling mistakes of specially -> especially. (#5235) 2016-09-21 10:27:34 +02:00
José Valim c05151f278 Update CHANGELOG 2016-09-17 22:40:54 +02:00
Pedro Medeiros 0d2870f050 Fix some exported from case from erlang source (#5214)
Some erlang code were emiting a warning message when some
variables were defined inside the case statement.
2016-09-14 13:45:32 +02:00
Michał Muskała dadf98fbff Introduce Process.send_after/4 (#5182) 2016-09-07 22:39:12 +02:00
José Valim 786da1ffe0 Add Kernel.rand/0 and Kernel.rand/1
Thanks to Hal Fulton for the proposal and original code.
2016-09-07 13:07:52 +02:00
Aleksei Magusev fd17c6fefa Produce meaningful warning when with's else clauses have no effect (#5179)
Isolated example:

  defmodule Foo do
    def foo(arg) do
      with foo = arg do
        foo
      else
        _ -> nil
      end
    end
  end
2016-09-04 01:55:39 +02:00
Michał Muskała 8277dcd776 Make sure bad remote call errors have file/line info (#5116)
Change how we mark the generated AST for suppressing dialyzer errors -
instead of [generated: true, location: 0], we provide proper line number.
This means, however, that on OTP 18, those nodes won't be recognized
as generated and warnings will be issued.
It was decided that proper error messages are more important than
avoiding bogus dialyzer warnings.
The old mark for generated code is left in places that made compiler
issue warnings on 18.

The bad remote call dialyzer warnings can be suppressed with the
@dialyzer :no_fail_call
module attribute.
2016-08-15 13:18:09 +01:00
Aleksei Magusev 34bf464bc1 Remove trailing period in error message for missing terminator 2016-08-13 00:44:49 +02:00
ottolin 5eb2e30b1a Enhancing error message for token matching failure (#5123) 2016-08-10 13:55:03 +02:00
José Valim 3c68af7ce3 Properly splice binaries inside binaries 2016-08-09 01:38:01 +02:00
José Valim 8ce699edc5 Always include the compiled file source in manifests
See https://github.com/plataformatec/nimble_csv/issues/4.
2016-08-04 20:12:24 +02:00
Michał Muskała 270c983b13 Mark struct update syntax as generated (#5067)
With changes to OTP 19, dialyzer started emitting warnings for
the struct update syntax where variable could only be that struct.
For example:

    def foo(%Foo{} = struct), do: %Foo{struct | bar: :baz}
2016-07-27 11:26:45 +02:00
José Valim 34052cfca0 Emit compilation warnings for HashDict, HashSet and Dict 2016-07-23 12:31:12 +02:00
José Valim 78c7ddc03f Simplify type splicing for binaries 2016-07-16 20:31:03 +02:00
Aleksei Magusev 3f9a4c044a Rewrite Enum.into/2,3 with empty map into Map.new/1,2 2016-07-09 16:31:30 +02:00
Aleksei Magusev 05db28b28f Rewrite Enum.reverse/1 to Enum.reverse/2 for non-lists 2016-07-08 23:33:54 +02:00
Andrea Leopardi d80038f86a Force defmodule to not be tail-call optimized (#4958) 2016-07-08 10:35:47 +02:00
Eric Entin 26063877da The else clause in with supports guards (#4960) 2016-07-07 20:26:35 +02:00
Artur Cygan d3ae3d5cb1 Improve error message when importing undefined or private function (#4946) 2016-07-06 00:42:19 +02:00
Andrea Leopardi dffebbe85b Remove defmacrop support in leftover code in elixir_def_overridable (#4922)
Support for private overridable macros was officially dropped in 3c88c16
we forgot to remove it from some code in elixir_def_overridable (which
is now harmless but superfluous code).
2016-07-01 23:31:41 +02:00
Eric Meadows-Jönsson c7081fd2aa Fix struct/0 typespec
Closes #4915.
2016-06-30 19:33:22 +02:00
Mike Stok 05431f6010 keep tokenizer's column counts in sync for numbers with _ characters
For providing better feedback in credo and tools like it we should be
able to map a token back to its original source.  This makes sure that
`_` characters in numbers are properly accounted for so that they stay
in sync after we've encountered something like 123_456_789.

Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2016-06-30 10:25:43 +01:00
José Valim 584f49f88c Do not attempt to load modules that have not been required, closes #4900
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2016-06-29 01:21:53 +01:00
José Valim b98b4bd235 Ensure structs can be expanded in dynamic module names, closes #4894 2016-06-28 10:30:15 +01:00
Eksperimental 31822b42f0 Properly spell PID (#4883) 2016-06-25 09:03:35 +02:00
Aleksei Magusev 654cd77501 Simplify function kind check in elixir_def_overridable.erl 2016-06-22 13:11:43 +02:00
Andrea Leopardi 881c2d6638 Support macros with defoverridable/super (#4848) 2016-06-22 11:40:24 +02:00
José Valim f4b5e43fc1 Explicitly announce structs
Before this patch, we could announce a struct too early,
only when __struct__/0 was defined (and not __struct__/1)
leading to deadlocks in the compiler. We fixed the bug and
made struct announcements to avoid future bugs.

Closes #4844
2016-06-22 10:05:01 +02:00
Daniel Perez e9f2c2547d Improve with/else error message on invalid form (#4847) 2016-06-22 09:30:54 +02:00
José Valim 077aca5db1 Do not expect stacktraces to be always present, closes #4840 2016-06-21 20:26:46 +02:00
Pedro Medeiros 0066d11771 Simplify code to remove warning: unsafe in 'case' (#4816) 2016-06-15 18:41:01 +02:00
José Valim 1aca21c876 Ensure variables in function clauses are not reused, closes #4815
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2016-06-15 16:14:48 +02:00
José Valim 5f34ad6dc7 Remove elixir_counter in favor of unique_integer
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2016-06-15 15:25:28 +02:00
José Valim 8d368a8836 Ensure entries are sorted to avoid non-determinism in compilation, closes #4814
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2016-06-15 15:25:24 +02:00
Eric Entin 2d7017fcc7 Make sure struct expansion results in a remote dispatch (#4807) 2016-06-12 23:38:51 +02:00
Aleksei Magusev 50c5ea5a03 Make sure with/1 does not leak variables to else (#4804) 2016-06-12 21:26:06 +02:00
José Valim 25ca5c825a Disable relative paths when loading mix.exs, closes #4465 2016-06-12 18:55:00 +02:00
Gary Rennie 9a74ea7520 Include with when warning about unsafe variables (#4800)
The unsafe variable warning can be triggered from the following `with`:

    state = true

    with true  <-state, state = !state,
    do: state,
    else: (other -> {other, state})
2016-06-12 15:37:39 +02:00
Aleksei Magusev 0bf89538c6 Standardize use of "variable" word in warnings and errors 2016-06-12 00:27:30 +02:00
Aleksei Magusev 96da837136 Emit warning when variable is being expanded to function call (#3517) 2016-06-11 22:31:03 +02:00
eksperimental 3bd976737e Use proper case for proper nouns and acronyms
Use proper case for proper nouns (e.g., Elixir, Rebar, Git, and others)
as well as acronyms (e.g., URL, HTTP, and others).
2016-06-06 15:17:59 +02:00
José Valim abec905009 Use a more explicit pdict key 2016-06-04 16:47:00 +02:00