Commit Graph
8436 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 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
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
Hassan Shaikley 9254b42b31 Clarify docs for List.to_integer/1 (#9443)
[ci skip]
2019-10-23 16:03:38 -05:00
José Valim 3a1ea76bc0 Improve diffing of escaped values on maps/structs 2019-10-22 16:11:24 +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 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 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
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
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
José Valim c0ae3645f7 Consider options when running regexes on the fly
Closes #9343.
2019-10-11 17:44:23 +02:00
Eksperimental 0eb3fbbf41 Update reference to Keyword.delete/3 (#9394)
ExDoc is giving a warning since it has been deprecated and @doc is set to false.
> warning: documentation references Keyword.delete/3 but it doesn't exist or it's listed as @doc false (parsing Keyword docs)
2019-10-11 06:01:02 -03:00
Eksperimental 1055b0b33b Close unclosed backticks in the docs (#9395)
[ci skip]

ExDoc was giving the following errors:
> lib/elixir/lib/string.ex:250: warning: Closing unclosed backquotes ` at end of input
> lib/elixir/lib/enum.ex:2319: warning: Closing unclosed backquotes ` at end of input
2019-10-11 10:40:43 +02:00
Eric Meadows-Jönsson c6da1cfaa8 Run checker on Code.require_file/1 (#9393)
Closes #9362.
2019-10-10 23:11:10 +02:00
José Valim f52f2c7952 Ensure compilation works for a variable named super, closes #9390 2019-10-09 19:11:04 +02:00
José Valim c5e3480f99 Clarify docs for syntax_colors, closes #9391 2019-10-09 17:40:54 +02:00
Eric Meadows-Jönsson b3993aca6e Use elixir_expand to simplify guard tests (#9388) 2019-10-08 19:25:57 +02:00
Eric Meadows-Jönsson 9f334a73ca Move map.ex to bootstrap (#9389) 2019-10-08 14:39:05 +02:00
Eric Meadows-Jönsson b3debbe1e8 Check more guard functions (#9386) 2019-10-08 04:02:20 +02:00
José Valim fd49a67f34 Add defmodule tracing event 2019-10-07 16:12:52 -03:00
Fernando Tapia Rico a861e5b732 Ensure reproducible builds (boostrapping issue) (#9385)
During bootstrap, the generated AST for the `defexception` macro
does not include import metadata when calling to Kernel functions
without using the qualified name. That's not the case when the
Kernel is later recompiled.

When compiling the standard library, exceptions like
`FunctionClauseError` were generating different ASTs (different
metadata) depending on if they were compiled with the bootstrapped
Kernel or the later compiled one.
2019-10-05 19:31:48 +02:00
Tobiasz Małecki 9cac52833e Improve Enum.sort/2 doc examples formatting (#9382) 2019-10-04 10:20:54 -03:00
Brett Beatty 0f5585dab8 Update docs for Kernel.SpecialForms.case/2 (#9378) 2019-10-03 07:37:57 +02:00
Keith 860f03f4c9 Update inspect.ex (#9377)
Subtle sentence restructuring to make it easier to read.
2019-10-03 02:19:05 -03:00
José Valim f664700258 Allow custom calendar representations in calendar sigils (#9367)
For this functionality to work, parse_time|date|naive_datetime|utc_datetime
were added to the Calendar behaviour.
2019-10-01 08:21:13 -03:00
abanichev 553b2b22a9 Minor typo fix (#9372) 2019-09-29 16:59:18 -03:00
aweagel 5120faa198 Fix type details in the child spec documentation (#9371)
[ci skip]
2019-09-28 12:02:59 +03:00
Fernando Tapia Rico 4253fdaead Fix typo in Stream documentation
[ci skip]
2019-09-27 12:11:47 +02:00