From 2286a6ed9b9a9b2870ec2cbb5a304c8e9334c5d5 Mon Sep 17 00:00:00 2001 From: Ariel Otilibili Date: Sat, 17 Feb 2024 21:59:32 +0100 Subject: [PATCH] Removed namespaced_types * introduced for handling deprecated types existing before R17 * introduced in 523a66ad7448cf4b49c6b803f1198e5b3e2c7960 * CI/CD handles R19 up to R24 * R19 and onwards have dict:dict/0 [1,2] [1] https://www.erlang.org/docs/19/man/dict [2] https://www.erlang.org/docs/24/man/dict#type-dict --- rebar.config | 3 +-- src/ec_dict.erl | 4 ---- src/ec_plists.erl | 14 -------------- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/rebar.config b/rebar.config index dcdc11e..aecc6a1 100644 --- a/rebar.config +++ b/rebar.config @@ -9,8 +9,7 @@ %% Compiler Options ============================================================ {erl_opts, - [{platform_define, "^[0-9]+", namespaced_types}, - {platform_define, "^2", unicode_str}, + [{platform_define, "^2", unicode_str}, {platform_define, "^(R|1|20)", fun_stacktrace}, debug_info, warnings_as_errors]}. diff --git a/src/ec_dict.erl b/src/ec_dict.erl index 0c0b998..3e9418e 100644 --- a/src/ec_dict.erl +++ b/src/ec_dict.erl @@ -34,11 +34,7 @@ %%%=================================================================== %% This should be opaque, but that kills dialyzer so for now we export it %% however you should not rely on the internal representation here --ifdef(namespaced_types). -type dictionary(_K, _V) :: dict:dict(). --else. --type dictionary(_K, _V) :: dict(). --endif. %%%=================================================================== %%% API diff --git a/src/ec_plists.erl b/src/ec_plists.erl index 846049d..cd9b915 100644 --- a/src/ec_plists.erl +++ b/src/ec_plists.erl @@ -480,16 +480,9 @@ usort(Fun, List, Malt) -> runmany(Fun2, {recursive, Fuse}, List, Malt). %% @doc Like below, assumes default MapMalt of 1. --ifdef(namespaced_types). -spec mapreduce(MapFunc, list()) -> dict:dict() when MapFunc :: fun((term()) -> DeepListOfKeyValuePairs), DeepListOfKeyValuePairs :: [DeepListOfKeyValuePairs] | {Key::term(), Value::term()}. --else. --spec mapreduce(MapFunc, list()) -> dict() when - MapFunc :: fun((term()) -> DeepListOfKeyValuePairs), - DeepListOfKeyValuePairs :: [DeepListOfKeyValuePairs] | {Key::term(), Value::term()}. --endif. - mapreduce(MapFunc, List) -> mapreduce(MapFunc, List, 1). @@ -518,17 +511,10 @@ mapreduce(MapFunc, List, MapMalt) -> %% %% mapreduce requires OTP R11B, or it may leave monitoring messages in the %% message queue. --ifdef(namespaced_types). -spec mapreduce(MapFunc, list(), InitState::term(), ReduceFunc, malt()) -> dict:dict() when MapFunc :: fun((term()) -> DeepListOfKeyValuePairs), DeepListOfKeyValuePairs :: [DeepListOfKeyValuePairs] | {Key::term(), Value::term()}, ReduceFunc :: fun((OldState::term(), Key::term(), Value::term()) -> NewState::term()). --else. --spec mapreduce(MapFunc, list(), InitState::term(), ReduceFunc, malt()) -> dict() when - MapFunc :: fun((term()) -> DeepListOfKeyValuePairs), - DeepListOfKeyValuePairs :: [DeepListOfKeyValuePairs] | {Key::term(), Value::term()}, - ReduceFunc :: fun((OldState::term(), Key::term(), Value::term()) -> NewState::term()). --endif. mapreduce(MapFunc, List, InitState, ReduceFunc, MapMalt) -> Parent = self(), {Reducer, ReducerRef} =