Commit Graph
8600 Commits
Author SHA1 Message Date
José Valim 0fdc7510b8 Remove guard checks on is_odd/is_even as those are tested in defguard, closes #9700 2020-01-12 16:00:12 +01:00
Eric Meadows-Jönsson 0e8873238d Do not warn for functions generated by Erlang compiler (#9713) 2020-01-12 15:42:54 +01:00
Eric Meadows-Jönsson ba02eb90a0 Allow any type on the RHS of or/2 (#9706)
Closes #9704.
2020-01-11 12:19:29 +01:00
Eric Meadows-Jönsson fdc7716bf3 Improve type check error message (#9705)
A type error may not always cause a clause to fail.

Related to #9700.
2020-01-11 12:19:29 +01:00
José Valim a050c00fbc Use meta on rewrites, closes #9714 2020-01-11 12:17:43 +01:00
José Valim 28b053a122 Prepare v1.10 release 2020-01-07 15:03:35 +01:00
Dmitry Kakurin 033c7387e2 Fix Path.absname/1 to correctly handle UNC paths on Windows (#9689) 2020-01-06 22:50:47 +01:00
Eric Meadows-Jönsson a72a388e1c Remove type inversion (#9695) 2020-01-06 20:05:17 +01:00
Wojtek Mach 440850f5a0 Point to the proper docs in the consolidation warning (#9696)
The docs are on the module nowadays: https://hexdocs.pm/elixir/master/Protocol.html#module-consolidation
2020-01-06 17:17:23 +01:00
Pete Matsyburka 54328e810f Optimize Enum.join/2 with empty string (#9697) 2020-01-06 17:15:13 +01:00
Wojtek Mach a256c5578e Add option :all to :no_warn_undefined (#9691) 2020-01-06 00:01:52 +01:00
Devon Estes ec65f8d48a Always capture delimiter metadata for sigils (#9671)
This makes it so we're always capturing delimiter metadata for sigils
instead of requiring the `token_metadata` option. This means that we can
now show the correct sigils in ExUnit diffs (and elsewhere) for code
examples.
2020-01-05 16:07:58 +01:00
Sascha Wolf f0fbf0241a IO.ANSI.Docs - Properly render quote blocks (#9684) 2020-01-05 15:54:24 +01:00
José Valim 51115133c4 Clarify usage of version and requires it in releases, closes #9686 2020-01-05 09:45:57 +01:00
José Valim 6760cdbf14 Run the formatter 2020-01-04 12:52:45 +01:00
José Valim b64d7488d0 Prepare for v1.10-rc (#9673) 2020-01-03 17:29:38 +01:00
José Valim 5dd271d361 Fix bounded funs in macrocallbacks, closes #9687 2020-01-03 17:18:27 +01:00
José Valim 3b16807374 Reduce the amount of data sent between compilation processes 2020-01-03 17:18:27 +01:00
Xavier Noria 2a3a38ef78 Fixes typo in Config docs [skip ci] (#9682) 2020-01-02 18:25:56 +01:00
Wojtek Mach 0c7d09c570 Document :file option on quote/2 (#9679) 2020-01-01 17:26:27 +01:00
José Valim 7f86ea3334 Allow reboot to be disabled in releases, closes #9552 2019-12-30 14:06:05 +01:00
José Valim 203d540c3a Fixes for new Macro.to_string behaviour 2019-12-24 11:57:02 +01:00
José Valim d2c9824ef9 Respect :no_parens meta in nullary remote calls in Macro.to_string
Closes #9668.
2019-12-24 11:41:02 +01:00
M. Peter 04c9c244f1 Update enum.ex docs for find_value (#9641) 2019-12-24 11:19:25 +01:00
José Valim 00abb3b6e3 Allow positive range slices on infinite streams
Closes #9653.
Closes #9654.
2019-12-24 11:17:23 +01:00
José Valim cf5e7d9f78 Clarify which keys are kept, closes #9657 2019-12-23 20:23:49 +01:00
José Valim 9e560c7909 Make sure error messages contain all relevant information
We have recently changed the compiler to emit a warning
for each undefined function with a generic error at the
end saying the module could not be defined.

Unfortunately, some tools like IDEs and Phoenix Reloader
give higher priority to errors over warnings, which means
an error would be shown but without any actionable
information.

This commit changes it so the first undefined function is
an error and all following ones are warnings.
2019-12-23 11:47:21 +01:00
sanposhiho 7e72cdf240 Add guards to enum index access (#9667) 2019-12-22 19:09:07 +01:00
Wojtek Mach bdc2e99c29 Improve error message on import/2 (#9663)
Before:

    iex(1)> a = [flatten: 1]; import List, only: a
    ** (CaseClauseError) no case clause matching: {:only, {:a, [version: 0, line: 1], nil}}
        (elixir 1.10.0-dev) src/elixir_import.erl:10: :elixir_import.import/4

After:

    iex(1)> a = [flatten: 1]; import List, only: a
    ** (CompileError) iex:1: invalid :only option for import, expected value to be an atom :functions, :macros, or a list literal, got: a
        (elixir 1.10.0-dev) src/elixir_import.erl:22: :elixir_import.import/4
2019-12-20 08:56:56 +01:00
Evan Travers c0ebd7a7a0 "matched pattern" -> "match" (#9662)
We seem to use "pattern" to describe the thing that is doing the
matching, and "match" to describe the _found_ object. This is intended
to make this docs more consistent with the language found in the `Regex`
module.

Fixes #9659
2019-12-19 23:52:07 +01:00
Martin Gausby 57fc6ff85c Fix spelling mistake in docs (#9660) 2019-12-19 12:09:43 +01:00
José Valim 46f6ba563b Allow nested cycles, closes #9652 2019-12-16 10:32:19 +01:00
Eksperimental 022cb66020 Use "code point" instead of "codepoint" (#9649)
That's the term it is used in the Unicode standard.
related commit 99d919e0c8
2019-12-13 18:46:48 +01:00
José Valim 4ba750b41b Clarify call syntax for Keyword, closes #9645 2019-12-13 09:40:51 +01:00
Dmitry Belyaev 6d89878dfc Replace UTF-8 code point with Unicode code point (#9643) 2019-12-13 09:39:54 +01:00
José Valim 352b95544a More improvements to Kernel typespecs 2019-12-12 09:48:08 +01:00
José Valim a66cea94b1 Update kernel.ex 2019-12-12 09:28:30 +01:00
José Valim 3b3c15b979 Do not add no_warn_undefined to CInf chunk 2019-12-09 10:33:35 +01:00
Eric Meadows-Jönsson 9394612a3d Remove signatures from checker chunk (#9634) 2019-12-07 18:09:50 +01:00
José Valim ba619b1c3e Add Application.compile_env/3 (#9628)
Mix stores the compile_env in each applications' .app file.

Releases and Mix tasks were also changed to validate against
the runtime configuration against any stored `compile_env`.
In case of mismatches, an error is raised during boot.
2019-12-06 17:23:01 +01:00
Eric Meadows-Jönsson 40799f2688 Preserve slashes in URIs without authority (#9632)
Old behavior:

    to_string(URI.parse("file:///path")) == "file:/path"

New behavior:

    to_string(URI.parse("file:///path")) == "file:///path"
2019-12-06 16:34:13 +01:00
Jan Hruban e1b14cad05 Close with correct accumulator in Stream.resource/3 (#9627)
In the optimized case with a single-element list returned from the
`next_fun`, call the stream function chain in a separate try/catch
block. If it errors out, call the `after_fun` with the new accumulator
returned from `next_fun`.

Previously the `after_fun` was called with the old accumulator in such
case.
2019-12-06 14:44:25 +01:00
José Valim 0a33059a10 Use .exs extension in config reader input 2019-12-04 16:40:51 +01:00
José Valim d2ac69eafa Ensure children are trapping exits before terminating 2019-12-04 12:33:01 +01:00
José Valim 917ad8ff2e Fix race conditions in impl test 2019-12-04 12:24:24 +01:00
José Valim 46fa678f42 Refactor elixir_config and mix compilers for upcoming changes 2019-12-04 11:59:51 +01:00
José Valim 60733b8d7c Print all undefined functions as warnings and then raise (#9623)
Sometimes one undefined function warning can hide others.
For example, in a function call like this:

    foo(bar 1, 2)

The user may be expecting it to be called as:

    foo(bar(1), 2)

But Elixir compiles it to:

    foo(bar(1, 2))

In this case, the warning would be one of "undefined
function foo/1" or "undefined function bar/2", but they
are only "half truths". By showing all undefined function
warnings, we improve errors like above and it allows
users to see all undefined calls at once, when it would
otherwise require them to compile the code multiple times.
2019-12-03 10:33:59 +01:00
Eksperimental b82ad0a512 Allows heading separator in IO.ANSI.Docs to not to have spaces around "|" (#9616)
This is supported by GFM (GitHub Flavored Markdown).
2019-12-03 10:01:02 +01:00
José Valim 6c0e49f0b7 Add examples to ambiguous op error message 2019-12-02 10:27:28 +01:00
Brandon Zylstra 949450e9ba Grammar suggestions for syntax reference (#9622) 2019-12-02 10:03:35 +01:00