File 0164-stdlib-Fix-spec-for-match_spec_run-2.patch of Package erlang
From 7029ac608a31904c294e0d99da1cf4f7750b5294 Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Tue, 23 Jan 2018 21:07:04 +0100
Subject: [PATCH 1/2] stdlib: Fix spec for match_spec_run/2
Matching can be done on any terms.
---
lib/stdlib/doc/src/ets.xml | 4 ++--
lib/stdlib/src/ets.erl | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/stdlib/doc/src/ets.xml b/lib/stdlib/doc/src/ets.xml
index 576959b1c8..7fdcf53607 100644
--- a/lib/stdlib/doc/src/ets.xml
+++ b/lib/stdlib/doc/src/ets.xml
@@ -830,11 +830,11 @@ ets:is_compiled_ms(Broken).</code>
</func>
<func>
<name name="match_spec_run" arity="2"/>
- <fsummary>Performs matching, using a compiled match_spec, on a list of tuples</fsummary>
+ <fsummary>Performs matching, using a compiled match_spec, on a list of terms</fsummary>
<desc>
<p>This function executes the matching specified in a
compiled <seealso marker="#match_spec">match_spec</seealso> on
- a list of tuples. The <c><anno>CompiledMatchSpec</anno></c> term should be
+ a list of terms. The <c><anno>CompiledMatchSpec</anno></c> term should be
the result of a call to <c>ets:match_spec_compile/1</c> and
is hence the internal representation of the match_spec one
wants to use.</p>
diff --git a/lib/stdlib/src/ets.erl b/lib/stdlib/src/ets.erl
index 1db004c91e..42fa8ede92 100644
--- a/lib/stdlib/src/ets.erl
+++ b/lib/stdlib/src/ets.erl
@@ -277,7 +277,7 @@ match_spec_compile(_) ->
erlang:nif_error(undef).
-spec match_spec_run_r(List, CompiledMatchSpec, list()) -> list() when
- List :: [tuple()],
+ List :: [term()],
CompiledMatchSpec :: comp_match_spec().
match_spec_run_r(_, _, _) ->
@@ -517,7 +517,7 @@ update_element(_, _, _) ->
-opaque comp_match_spec() :: binary(). %% this one is REALLY opaque
-spec match_spec_run(List, CompiledMatchSpec) -> list() when
- List :: [tuple()],
+ List :: [term()],
CompiledMatchSpec :: comp_match_spec().
match_spec_run(List, CompiledMS) ->
--
2.16.0