Skip to content

Commit 9ce8d04

Browse files
committed
Schedule old style type tests for removal in OTP 30
1 parent 64c8ae9 commit 9ce8d04

File tree

2 files changed

+33
-7
lines changed

2 files changed

+33
-7
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: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,35 @@
11
<!--
2-
%CopyrightBegin%
3-
4-
SPDX-License-Identifier: Apache-2.0
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+
-->
522

6-
Copyright Ericsson AB 2025. All Rights Reserved.
23+
### Old aliases for type tests in guards
724

8-
%CopyrightEnd%
9-
-->
25+
The aliases `atom/1`, `tuple/1`, etc., for the respective type tests
26+
`is_atom/1`, `is_tuple/1`, etc., have been deprecated since before OTP R13
27+
and have been scheduled for removal in OTP 30. Note that these aliases only
28+
could be used as guard tests at the top level. For example, in `{X, Y} when
29+
float(X), X =:= float(Y) -> ...` the first use of `float/1` is a type test
30+
alias, but the second use is the normal integer-to-float conversion BIF,
31+
because it occurs inside the `=:=`. The aliases were never recognized
32+
outside guards.
1033

1134
### Distribution Control Messages
1235

0 commit comments

Comments
 (0)