aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-12-06 14:14:07 +0100
committerBjörn Gustavsson <[email protected]>2012-12-06 14:14:07 +0100
commitca3b66e3d2c734e8715c7ed078e4fa9ae10462de (patch)
treecbb1f4a8d034b09813453ae9f20a4d5465249fc8
parent5b40d5502f008f9c44bc4a3bd9037439e35ce0a7 (diff)
parent0b73bb47674574e3e449d780c5704b02b15a8e07 (diff)
downloadotp-ca3b66e3d2c734e8715c7ed078e4fa9ae10462de.tar.gz
otp-ca3b66e3d2c734e8715c7ed078e4fa9ae10462de.tar.bz2
otp-ca3b66e3d2c734e8715c7ed078e4fa9ae10462de.zip
Merge branch 'bjorn/remove-tuple-funs/OTP-10170'
* bjorn/remove-tuple-funs/OTP-10170: erl_expand_records: Remove stale support for literal tuple funs Teach is_function/2 that tuples are not funs
-rw-r--r--erts/doc/src/erlang.xml7
-rw-r--r--erts/emulator/beam/erl_bif_op.c5
-rw-r--r--erts/emulator/test/fun_SUITE.erl4
-rw-r--r--lib/stdlib/src/erl_expand_records.erl3
4 files changed, 2 insertions, 17 deletions
diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml
index ef0e6fea84..5002c48ca1 100644
--- a/erts/doc/src/erlang.xml
+++ b/erts/doc/src/erlang.xml
@@ -1497,13 +1497,6 @@ os_prompt% </pre>
applied with <c><anno>Arity</anno></c> number of arguments; otherwise
returns <c>false</c>.</p>
<p>Allowed in guard tests.</p>
- <warning>
- <p>Currently, <c>is_function/2</c> will also return
- <c>true</c> if the first argument is a tuple fun (a tuple
- containing two atoms). In a future release, tuple funs will
- no longer be supported and <c>is_function/2</c> will return
- <c>false</c> if given a tuple fun.</p>
- </warning>
</desc>
</func>
<func>
diff --git a/erts/emulator/beam/erl_bif_op.c b/erts/emulator/beam/erl_bif_op.c
index 13f8b1f63c..d4cd9c89b3 100644
--- a/erts/emulator/beam/erl_bif_op.c
+++ b/erts/emulator/beam/erl_bif_op.c
@@ -261,11 +261,6 @@ Eterm erl_is_function(Process* p, Eterm arg1, Eterm arg2)
if (exp->code[2] == (Uint) arity) {
BIF_RET(am_true);
}
- } else if (is_tuple(arg1)) {
- Eterm* tp = tuple_val(arg1);
- if (tp[0] == make_arityval(2) && is_atom(tp[1]) && is_atom(tp[2])) {
- BIF_RET(am_true);
- }
}
BIF_RET(am_false);
}
diff --git a/erts/emulator/test/fun_SUITE.erl b/erts/emulator/test/fun_SUITE.erl
index ef06845cf2..36ba4e0f48 100644
--- a/erts/emulator/test/fun_SUITE.erl
+++ b/erts/emulator/test/fun_SUITE.erl
@@ -726,8 +726,8 @@ t_arity(Config) when is_list(Config) ->
ok.
t_is_function2(Config) when is_list(Config) ->
- ?line true = is_function({a,b}, 0),
- ?line true = is_function({a,b}, 234343434333433433),
+ false = is_function(id({a,b}), 0),
+ false = is_function(id({a,b}), 234343434333433433),
?line true = is_function(fun() -> ok end, 0),
?line true = is_function(fun(_) -> ok end, 1),
?line false = is_function(fun(_) -> ok end, 0),
diff --git a/lib/stdlib/src/erl_expand_records.erl b/lib/stdlib/src/erl_expand_records.erl
index 9759a8f001..85defacc43 100644
--- a/lib/stdlib/src/erl_expand_records.erl
+++ b/lib/stdlib/src/erl_expand_records.erl
@@ -381,9 +381,6 @@ expr({call,Line,{record_field,_,_,_}=M,As0}, St0) ->
expr({call,Line,{remote,Lr,M,F},As0}, St0) ->
{[M1,F1 | As1],St1} = expr_list([M,F | As0], St0),
{{call,Line,{remote,Lr,M1,F1},As1},St1};
-expr({call,Line,{tuple,Lt,[{atom,_,_}=M,{atom,_,_}=F]},As0}, St0) ->
- {As,St1} = expr_list(As0, St0),
- {{call,Line,{tuple,Lt,[M,F]},As},St1};
expr({call,Line,F,As0}, St0) ->
{[Fun1 | As1],St1} = expr_list([F | As0], St0),
{{call,Line,Fun1,As1},St1};