Commit Graph
8844 Commits
Author SHA1 Message Date
José Valim 4a2047af1f Keep proper precedence in guards generated by in/2, closes #10138 2020-07-01 00:17:16 +02:00
José Valim 739a41f54f Do not use backticks in error messages, simplify field/fun printing (#10139) 2020-06-30 22:35:22 +02:00
José Valim 16d3522a6c Update TODOs 2020-06-30 15:51:33 +02:00
Eric Meadows-Jönsson ea885f293c Add map checks (#10136) 2020-06-30 13:26:52 +02:00
José Valim a00178092e Raise if lists have more than 1023 elements in guards
Closes #10114
2020-06-29 15:13:28 +02:00
Wojtek Mach e935cf0784 Add :tmp_dir tag to ExUnit (#10135) 2020-06-29 13:51:07 +02:00
José Valim 72adfa330d Normalize paths before expanding them (#10132)
Closes #9896
2020-06-28 14:29:50 +02:00
Eric Meadows-Jönsson e6e5d2a98d Add Version test for pre-release fields
If a pre-release field compares lexically or numerically higher then it
does not matter that it may have less fields in total.

Closes #10126.
2020-06-26 12:56:01 +02:00
Fernando Tapia Rico 51755e2ee9 Use monotonic times to measure compilation times
By using monotonic times the accuracy of the elapsed time is not
affected by adjustments in the system time.
2020-06-25 20:37:00 +02:00
Michał Muskała aace60b863 Fix bug in Inspect.AlgebraTest (#10128) 2020-06-25 17:03:32 +02:00
José Valim 0166ee82a1 Do not read from ExCk chunk if not necessary
Since all information is in the debug chunk, we use
that instead. This also allows us to remove
`no_warn_undefined` from the ExCk chunk.
2020-06-25 15:34:46 +02:00
José Valim e51cc8b88c Also track exports API via local deps 2020-06-25 15:09:14 +02:00
José Valim 16fafe2117 Fix CI 2020-06-25 13:01:57 +02:00
José Valim 8b4ec95a99 Revert "Consistently handle empty blocks"
Actually, we don't allow `-> [EMPTY]` anywhere else.

This reverts commit 3c6891cb7d.
2020-06-25 12:32:07 +02:00
José Valim 2b2587c68c Include compilation time of individual modules on --profile=time
For example, in Plug, you might see:

    [profile] lib/plug/conn.ex compiled in 935ms
    [profile] lib/plug/ssl.ex compiled in 147ms (plus 744ms waiting)
    [profile] lib/plug/static.ex compiled in 238ms (plus 654ms waiting)
    [profile] lib/plug/csrf_protection.ex compiled in 237ms (plus 790ms waiting)
    [profile] lib/plug/debugger.ex compiled in 719ms (plus 947ms waiting)
    [profile] Finished compilation cycle of 60 modules in 1802ms
    [profile] Finished group pass check of 60 modules in 75ms

This commit also increases the precision of --long-compilation-threshold
which now tracks only the time spent compiling and not the time waiting.
For this reason, we have reduced the threshold time to 10 seconds.
2020-06-25 12:29:59 +02:00
José Valim 3c6891cb7d Consistently handle empty blocks 2020-06-24 20:48:05 +02:00
José Valim 9a6db666a1 Do not make requires/imports compile-time dependencies
Previously, imports and requires were always added as
compile-time dependencies. With this change, they are
"export" dependencies, which are dependencies that depend
on the API defined by a module, such as struct and its
public definitions.

This change should drastically remove the amount of
modules recompiled in Elixir, making imports more feasible
for large projects.
2020-06-24 14:30:00 +02:00
Qqwy / Wiebe-Marten 3ed1a66432 Fixes tiny typo (missing article) (#10119) 2020-06-22 01:01:36 +02:00
Ioannis Pinakoulakis 6666b7bb31 Typos on the erlang files (#10118) 2020-06-21 11:14:11 +02:00
Ioannis Pinakoulakis 2b264cbd32 Fixes typos in comments and documentation (#10117) 2020-06-20 15:19:57 +02:00
Pavel Shpak 6a8867c66f Fix typo in Typespecs page (#10113) 2020-06-20 10:13:12 +02:00
José Valim 69df6543fb Remove reference to Erlang compile notes 2020-06-20 10:12:01 +02:00
Eksperimental 92756bd679 Correct doc, add spec and update TODO comment in System.stacktrace/0 (#10112) 2020-06-20 09:43:02 +02:00
Mitchell Henke 75e5609364 include callers in translated Logger metadata for Task (#10111) 2020-06-19 20:50:48 +02:00
José Valim 5725832003 Clarify whereis docs, closes #10106 2020-06-17 16:11:34 +02:00
Eksperimental 53d66875d7 Use Erlang/OTP "VERSION", instead of OTP "VERSION" (#10105) 2020-06-17 15:13:17 +02:00
Andrea Leopardi 18540250e2 Document performance updates to --/2 since OTP 22
Closes #10104.
2020-06-17 14:53:31 +02:00
José Valim 8744a3cde8 Clarify use cases around at_exit/1 2020-06-16 19:58:23 +02:00
José Valim 4bc45a7b63 Make exception types public, closes #10103 2020-06-16 11:05:37 +02:00
José Valim b56c262db3 Only run in interactive mode if there is a config provider
We also don't hardcode the RELEASE_MODE config variable
inside Config.Provider, instead we use the application
environment. To make this possible, we simplify the boot
signature for the provider so it only calls boot/0 instead
of a dynamic app-key pair.
2020-06-14 10:53:26 +02:00
Samuel Gordalina ed63846b4d Change release default mode to interactive (#10091) 2020-06-14 09:14:32 +02:00
Kelvin Stinghen 83374a88c9 Rewording the default arguments warnings (#10097) 2020-06-13 11:28:09 +02:00
José Valim cc138f37f2 Add line numbers to deprecated imports 2020-06-11 15:59:07 +02:00
José Valim 0df37749af Use reserved word where appropriate instead of token/keyword 2020-06-11 10:34:50 +02:00
José Valim 8148d079bf Remove code duplication between calendar modules 2020-06-11 09:51:37 +02:00
Kelvin Stinghen 091bb1b5b5 Adding gregorian seconds functions to DateTime (#10089) 2020-06-11 09:35:17 +02:00
Kelvin Stinghen b76e73abbc Returning microseconds on NaiveDateTime.to_gregorian_seconds (#10082) 2020-06-11 09:31:48 +02:00
Wojtek Mach 3757e36ed7 Don't add compile-time dependency on defdelegate (#10093)
The dependency doesn't seem needed in this case.

We go through extra hoops to maintain dynamic invocations where
`opts` is not a compile-time list and :to is not a literal.

An easy way to see this optimization is:

    defmodule A do
      defdelegate f(), to: B
    end

    defmodule B do
      def f() do
        :ok
      end
    end

    $ touch lib/b.ex && mix compile --verbose
    Compiling 1 file (.ex)
    Compiled lib/b.ex

vs:

    defmodule A do
      opts = [to: B]
      defdelegate f(), opts
    end

    defmodule B do
      def f() do
        :ok
      end
    end

    $ touch lib/b.ex && mix compile --verbose
    Compiling 2 files (.ex)
    Compiled lib/b.ex
    Compiled lib/a.ex
2020-06-11 09:31:12 +02:00
James Russo ef2785326c Add new! to Calendar Types (#10069)
Add new! to Date/Time/NaiveDateTime/DateTime. This also adds
new to DateTime.
2020-06-07 19:34:53 +02:00
José Valim 0bbcb8f280 Add is_map_key as a function that returns booleans 2020-06-07 17:27:12 +02:00
Garth Kidd d9e01a61c9 Clarify @doc for Registry.unregister_match/4 (#10079) 2020-06-04 09:01:51 +02:00
Jeroen Visser bdd2218b61 Link to Typespec docs from Module documentation (#10072) 2020-06-01 16:43:11 +02:00
Qqwy / Wiebe-Marten b9209ad1ac Improves 'patterns-and-guards' documentation page (#10065) 2020-05-28 18:59:28 +02:00
JoseHZBY 7456b5789b Update patterns-and-guards.md (#10064) 2020-05-25 18:37:50 +02:00
Cẩm Huỳnh 291ebf7458 Check function arity in ParallelCompiler.async (#10060) 2020-05-24 18:09:14 +02:00
Cleidiano Oliveira 70da709881 Allow user to define a type named union (#10055) 2020-05-23 12:41:17 +02:00
José Valim 44061c8499 Do not crash when checking empty receive 2020-05-22 10:58:12 +02:00
Michał Łępicki ce05be75eb Correct the specs for Enum aggregate functions (#10050) 2020-05-19 12:25:45 +02:00
Michał Łępicki df58c00e20 Update Enum.min_max_by/3 spec after #10033 (#10049)
#10033 added a third argument sorter_or_empty_fallback with a default value. To not break compatibility with existing code it also added a function clause that checks third argument's type with a guard and calls Enum.min_max_by/4 with appropriate arguments.

This commit fixes the following dialyzer warnings:

- In user code, e.g. `Enum.min_max_by([1, 2, 3], fn x -> x end, fn -> raise(Enum.EmptyError) end)`:
    The function call will not succeed.
    Enum.min_max_by([1, 2, 3], (_ -> any()), (() -> none()))
    will never return since it differs in arguments with
    positions 3rd from the success typing arguments:
    (any(), (_ -> any()), atom() | (_, _ -> boolean()))

- When running dialyzer on Elixir itself (erlang notation):
    Invalid type specification for function 'Elixir.Enum':min_max_by/3. The success typing is 
    (_, fun((_) -> any()), atom() | fun((_, _) -> boolean())) -> any()
2020-05-19 11:20:41 +02:00
Daniel Fischer 61910595d3 Fix typo (#10048)
Update "choosen" to "chosen"
2020-05-19 07:52:18 +02:00