Skip to content

Commit 0f98218

Browse files
authored
Merge pull request #10417 from richcarl/drop-old-type-tests-schedule
Schedule old style type tests for removal in OTP 30 OTP-19887
2 parents 104942d + fdc7ead commit 0f98218

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed

lib/stdlib/src/erl_lint.erl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,10 @@ format_error_1({removed_type, MNA, String}) ->
393393
format_error_1({removed_callback, MNA, String}) ->
394394
{~"the callback ~s is removed; ~s", [format_mna(MNA), String]};
395395
format_error_1({obsolete_guard, {F, A}}) ->
396-
{~"~p/~p obsolete (use is_~p/~p)", [F, A, F, A]};
396+
{~"""
397+
~p/~p as a type test is obsolete and will be
398+
removed in OTP 30; use is_~p/~p instead.
399+
""", [F, A, F, A]};
397400
format_error_1({obsolete_guard_overridden,Test}) ->
398401
{~"""
399402
obsolete ~s/1 (meaning is_~s/1) is illegal when there is a

system/doc/general_info/scheduled_for_removal_30.md

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,39 @@
11
<!--
2-
%CopyrightBegin%
2+
%% %CopyrightBegin%
3+
%%
4+
%% SPDX-License-Identifier: Apache-2.0
5+
%%
6+
%% Copyright Ericsson AB 2024-2025. All Rights Reserved.
7+
%%
8+
%% Licensed under the Apache License, Version 2.0 (the "License");
9+
%% you may not use this file except in compliance with the License.
10+
%% You may obtain a copy of the License at
11+
%%
12+
%% http://www.apache.org/licenses/LICENSE-2.0
13+
%%
14+
%% Unless required by applicable law or agreed to in writing, software
15+
%% distributed under the License is distributed on an "AS IS" BASIS,
16+
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
%% See the License for the specific language governing permissions and
18+
%% limitations under the License.
19+
%%
20+
%% %CopyrightEnd%
21+
-->
322

4-
SPDX-License-Identifier: Apache-2.0
23+
### Old aliases for type tests in guards
24+
25+
The type test aliases `atom/1`, `binary/1`, `float/1`, `function/1`,
26+
`integer/1`, `list/1`, `number/1`, `pid/1`, `port/1`, `record/2`,
27+
`reference/1`, and `tuple/1`, for the respective tests `is_atom/1`,
28+
`is_binary/1`, `is_float/1`, ..., `is_tuple/2`, have been deprecated since
29+
before OTP R13 and have been scheduled for removal in OTP 30. Note that
30+
these aliases could only be used as guard tests at the top level. For
31+
example, in `{X, Y} when float(X), X =:= float(Y) -> ...` the first use of
32+
`float/1` is a type test alias, but the second use is the normal
33+
integer-to-float conversion BIF, because it occurs inside the `=:=`. The
34+
aliases were never recognized outside guards.
535

6-
Copyright Ericsson AB 2025. All Rights Reserved.
736

8-
%CopyrightEnd%
9-
-->
1037

1138
### Distribution Control Messages
1239

0 commit comments

Comments
 (0)