Skip to content

Commit 767e347

Browse files
committed
Require Erlang/OTP 22+
1 parent 863c498 commit 767e347

File tree

6 files changed

+13
-46
lines changed

6 files changed

+13
-46
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ If Elixir fails to build (specifically when pulling in a new version via
4848
If tests pass, you can use Interactive Elixir by running `bin/iex` in your terminal.
4949

5050
However, if tests fail, it is likely that you have an outdated Erlang/OTP version
51-
(Elixir requires Erlang/OTP 21.0 or later). You can check your Erlang/OTP version
51+
(Elixir requires Erlang/OTP 22.0 or later). You can check your Erlang/OTP version
5252
by calling `erl` in the command line. You will see some information similar to:
5353

54-
Erlang/OTP 21 [erts-9.0] [smp:2:2] [async-threads:10] [kernel-poll:false]
54+
Erlang/OTP 22 [erts-9.0] [smp:2:2] [async-threads:10] [kernel-poll:false]
5555

5656
If you have properly set up your dependencies and tests still fail,
5757
you may want to open up a bug report, as explained next.

lib/elixir/lib/application.ex

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -694,9 +694,6 @@ defmodule Application do
694694
:application.set_env(app, key, value, opts)
695695
end
696696

697-
# TODO: Remove this once we support Erlang/OTP 22+ exclusively.
698-
@compile {:no_warn_undefined, {:application, :set_env, 2}}
699-
700697
@doc """
701698
Puts the environment for multiple apps at the same time.
702699
@@ -705,28 +702,14 @@ defmodule Application do
705702
* have the same application listed more than once
706703
* have the same key inside the same application listed more than once
707704
708-
If those conditions are not met, the behaviour is undefined
709-
(on Erlang/OTP 21 and earlier) or will raise (on Erlang/OTP 22
710-
and later).
705+
If those conditions are not met, it will raise.
711706
712707
It receives the same options as `put_env/4`. Returns `:ok`.
713708
"""
714709
@doc since: "1.9.0"
715710
@spec put_all_env([{app, [{key, value}]}], timeout: timeout, persistent: boolean) :: :ok
716711
def put_all_env(config, opts \\ []) when is_list(config) and is_list(opts) do
717-
# TODO: Remove function exported? check when we require Erlang/OTP 22+
718-
if function_exported?(:application, :set_env, 2) do
719-
:application.set_env(config, opts)
720-
else
721-
for app_keyword <- config,
722-
{app, keyword} = app_keyword,
723-
key_value <- keyword,
724-
{key, value} = key_value do
725-
:application.set_env(app, key, value, opts)
726-
end
727-
728-
:ok
729-
end
712+
:application.set_env(config, opts)
730713
end
731714

732715
@doc """

lib/elixir/lib/gen_server.ex

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,6 @@ defmodule GenServer do
585585
586586
This callback is optional. If one is not implemented, the server will fail
587587
if a continue instruction is used.
588-
589-
This callback is only supported on Erlang/OTP 21+.
590588
"""
591589
@callback handle_continue(continue :: term, state :: term) ::
592590
{:noreply, new_state}
@@ -1038,18 +1036,8 @@ defmodule GenServer do
10381036
is unknown whether the destination `server` successfully
10391037
handled the message.
10401038
1041-
`c:handle_cast/2` will be called on the server to handle
1042-
the request. In case the `server` is on a node which is
1043-
not yet connected to the caller one, the semantics differ
1044-
depending on the used Erlang/OTP version.
1045-
10461039
`server` can be any of the values described in the "Name registration"
10471040
section of the documentation for this module.
1048-
1049-
Before Erlang/OTP 21, the call is going to block until a
1050-
connection happens. This was done to guarantee ordering.
1051-
Starting with Erlang/OTP 21, both Erlang and Elixir do
1052-
not block the call.
10531041
"""
10541042
@spec cast(server, term) :: :ok
10551043
def cast(server, request)

lib/elixir/lib/integer.ex

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -318,18 +318,17 @@ defmodule Integer do
318318

319319
defp count_digits_nosign(<<_::bits>>, _, count), do: count
320320

321-
# TODO: Remove Integer.to_string/1 once the minimum supported version is
322-
# Erlang/OTP 22, since it is covered by the now BIF Integer.to_string/2.
323-
# Please reapply commit 2622fd6b0aa419a983a899a1fbdb5deefba3d85d.
324321
@doc """
325322
Returns a binary which corresponds to the text representation
326323
of `integer` in the given `base`.
327324
328-
`base` can be an integer between 2 and 36. If no `base` is given, it defaults to `10`.
325+
`base` can be an integer between 2 and 36. If no `base` is given,
326+
it defaults to `10`.
329327
330328
Inlined by the compiler.
331329
332330
## Examples
331+
333332
iex> Integer.to_string(123)
334333
"123"
335334
@@ -357,13 +356,12 @@ defmodule Integer do
357356
:erlang.integer_to_binary(integer, base)
358357
end
359358

360-
# TODO: Remove Integer.to_charlist/1 once the minimum supported version is
361-
# Erlang/OTP 22, since it is covered by the now BIF Integer.to_charlist/2.
362-
# Please reapply commit 2622fd6b0aa419a983a899a1fbdb5deefba3d85d.
363359
@doc """
364-
Returns a charlist which corresponds to the text representation of `integer` in the given `base`.
360+
Returns a charlist which corresponds to the text representation
361+
of `integer` in the given `base`.
365362
366-
`base` can be an integer between 2 and 36. If no `base` is given, it defaults to `10`.
363+
`base` can be an integer between 2 and 36. If no `base` is given,
364+
it defaults to `10`.
367365
368366
Inlined by the compiler.
369367

lib/iex/lib/iex.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ defmodule IEx do
312312
results in:
313313
314314
$ iex
315-
Erlang/OTP 21 [...]
315+
Erlang/OTP 22 [...]
316316
317317
hello world
318318
Interactive Elixir - press Ctrl+C to exit (type h() ENTER for help)
@@ -336,7 +336,7 @@ defmodule IEx do
336336
Now run the shell:
337337
338338
$ iex
339-
Erlang/OTP 21 [...]
339+
Erlang/OTP 22 [...]
340340
341341
Interactive Elixir - press Ctrl+C to exit (type h() ENTER for help)
342342
iex(1)> [1, 2, 3, 4, 5]

lib/logger/lib/logger/translator.ex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ defmodule Logger.Translator do
3434
"""
3535
def translate(min_level, level, kind, message)
3636

37-
## Erlang/OTP 21 and after
38-
3937
def translate(min_level, _level, :report, {:logger, %{label: label} = report}) do
4038
case label do
4139
{:gen_server, :terminate} ->

0 commit comments

Comments
 (0)