Commit Graph
13110 Commits
Author SHA1 Message Date
Gary Rennie 6a8fa2c7ef Warn if duplicate key is found in struct (#9452)
Warning is the preferable solution for this, if we raise instead then it
is likely that there are some existing libraries that use duplicate
struct keys that will break.
2019-10-28 20:01:31 -05:00
José Valim a570d919da Speed up map intersperse for lists 2019-10-28 22:12:06 +01:00
HUANG Wei 21de3ae040 Introduce Enum.map_intersperse (#9454)
Fixes #9451
2019-10-28 21:41:14 +01:00
José Valim ef7fba17a0 Simplify :language check in compile.app 2019-10-27 10:31:00 +01:00
Wojtek Mach 590daa8ba7 Document escript main/1 behaviour with language: :erlang (#9449) 2019-10-27 10:10:42 +01:00
José Valim a23f179e42 Load IO opts only if file is empty 2019-10-26 22:17:54 +02:00
Michał 0ebc911237 Fix reading whole file opened as :charlist (#9448)
Also make :io.getopts for StringIO consistent with other devices.
2019-10-26 22:09:13 +02:00
Glauber Campinho 7dd86ec1f7 Execute callbacks on :elixir_compiler after all warnings are emitted (#9447)
Currently the callbacks on :elixir_compiler are called before the warnings of unused aliases and imports are emitted, causing the messages to not consumed during the compilation. This commit changes `:elixir_lexical.run/2` to `:elixir_lexical.run/3` splitting the callback in two, one during the execution to evaluate the forms and another to be called after all the warnings are emitted.

Fixes #9440
2019-10-26 10:58:28 +02:00
José Valim 560e721b9b Remove unused funtionality and erase pdict properly 2019-10-25 15:29:46 +02:00
José Valim 642a794ace Allow a sorting function on min/max/min_by/max_by (#9427) 2019-10-24 12:51:31 +02:00
Devon Estes f3a177629f Escape strings before diffing them (#9442) 2019-10-24 10:03:37 +02:00
Hiroaki Osawa 83f75008ca Update frequencies and frequency_by to avoid the fun overhead (#9444) 2019-10-24 09:07:37 +02:00
José Valim 387aa6eb17 Add asc/desc and compare support to Enum.sort (#9432) 2019-10-24 00:05:19 +02:00
José Valim 9e8749b7c6 Allow start_options to be configured on Logger (#9438) 2019-10-24 00:03:50 +02:00
Hassan Shaikley 9254b42b31 Clarify docs for List.to_integer/1 (#9443)
[ci skip]
2019-10-23 16:03:38 -05:00
José Valim f1cfa523ff Discard metadata in the formatter rather than backend
Some formatters may want to format all of the metadata,
so we shouldn't forbid them of doing so.
2019-10-22 23:04:43 +02:00
José Valim b247d7c991 Fix pending test 2019-10-22 16:52:09 +02:00
José Valim 4056d05527 Run formatter 2019-10-22 16:38:34 +02:00
José Valim 3a1ea76bc0 Improve diffing of escaped values on maps/structs 2019-10-22 16:11:24 +02:00
José Valim 26e6938ff1 Sort release maps alphabetically 2019-10-22 14:01:02 +02:00
José Valim 649914c394 Validate bind_quoted, closes #9406 2019-10-21 21:08:02 +02:00
José Valim 69d085abd4 Improve errors for calls on aliases 2019-10-21 21:02:00 +02:00
José Valim b7e0e1002b Add tests for spawn_opt being passed downstream and fix Supervisor spec 2019-10-21 19:10:21 +02:00
Eksperimental e6f9cfb535 Fix specs in IEx related to break (#9433) 2019-10-21 17:14:44 +02:00
Wojtek Mach e85bcd86e5 Add Mix.SCM.t type and improve Mix.Project.deps_scms docs (#9437) 2019-10-21 06:46:24 -05:00
Thth 09d59d4d19 Fix typo in release docs (#9435)
[ci skip]
2019-10-21 10:19:43 +02:00
José Valim c126521868 Add Mix.Project.deps_scms/1 2019-10-20 21:01:46 +02:00
Eksperimental cb9c6e196f Introduce Code.binding/0 type (#9424) 2019-10-20 09:37:01 +02:00
Hiroaki Osawa b7b6480b9c Add Enum.frequencies/1 and Enum.frequencies_by/2 (#9425) 2019-10-19 06:29:48 -05:00
Ben Olive 14af6e451a Reword docs for :static_atoms_encoder (#9431)
[ci skip]
2019-10-19 06:28:06 -05:00
José Valim d0b2e7279b Keep inspected forms and avoid false positives in structs
Closes #9429.
2019-10-19 12:43:07 +02:00
José Valim dec321f286 Add since annotation to callbacks too 2019-10-19 10:55:04 +02:00
Wojtek Mach b9ba6aece9 Add example compilation tracer to docs (#9430) 2019-10-19 00:23:33 +02:00
Hassan Shaikley e280d89951 DynamicSupervisor Documentation polish (#9428) 2019-10-18 20:56:29 +02:00
Eric Meadows-Jönsson 6d3e3fa7d1 Add ++ to pattern inference (#9420)
* Add ++ to pattern inference

* Unknown types in list should return list(dynamic())
2019-10-17 15:16:04 +02:00
José Valim 058b2243df Add mix test partitioning (#9422) 2019-10-17 13:58:33 +02:00
Eksperimental 7c102e8461 Fix ExUnit.Case.env/0 type (#9423)
Module.t/0 doesn't exist.
2019-10-17 11:38:07 +02:00
José Valim 012ccf980a Ensure shell is reverted after mix test run 2019-10-16 23:48:17 +02:00
José Valim e465d2f5d6 Structure mix/tasks/test_test.exs with describe 2019-10-16 23:48:17 +02:00
Eric Meadows-Jönsson d46f0bd825 Support counter for var context (#9419) 2019-10-16 17:33:22 +02:00
Cade Ward 1ae0e436f7 Add guard to String.replace/4 for better error messages (#9398) 2019-10-16 16:22:20 +02:00
Eksperimental 706b3b122f Fix typespec for Calendar.ISO.year_of_era/1 (#9414)
Dialyzer was giving this error:

> lib/calendar/iso.ex:672: Type specification 'Elixir.Calendar.ISO':year_of_era(year()) -> {year(),era::0..1} is a supertype of the success typing: 'Elixir.Calendar.ISO':year_of_era
          (integer()) -> {pos_integer(), 0 | 1}
2019-10-16 08:59:31 +02:00
José Valim 8dc4e06c73 Mark match? catch-all clause as generated, closes #9411 2019-10-15 10:24:38 +02:00
Eksperimental 97119f17ea Use double-quotes around sections to refer to them (#9409)
[ci skip]
2019-10-15 08:57:44 +02:00
Eksperimental 99747c564f quote/2: Sort option fields in documentation (#9408) 2019-10-14 23:10:59 +02:00
Fernando Tapia Rico a01d7751ec Remove redundant guard
Kudos to @michalmuskala
2019-10-14 11:57:51 +02:00
Eksperimental 2063105cbd Standardize use of verbs in bulleted lists (#9403)
* Use imperative verbs in bulleted lists
* Use "does not" instead of "do not" in bulleted lists

Related: 690c2c40c9

[ci skip]
2019-10-14 09:47:08 +02:00
Eksperimental ee9c5065a7 Macro.Env: Sort fields in documentation and code (#9404) 2019-10-14 09:20:41 +02:00
Eksperimental 1c4ddd6c21 ExUnit.Callbacks: Be explicit about the shape of a return value (#9399)
Be explicit and also used a valid typespec (`keywords` is not valid,
but `keyword` is).
2019-10-13 19:00:59 +02:00
Fernando Tapia Rico 66a289056e Raise when passing an empty list instead of clauses (#9402)
This fixes an edge case in which the compiler will process an
empty list value (`[]`) as a block with no clauses, which is not
possible.

Here is an example:

    with {:ok, value} <- Map.fetch(%{a: 1}, :a) do
      value
    else
      []
    end

With this change, the code above will not compile.
2019-10-13 16:50:05 +02:00