aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-10-28 10:10:22 +0200
committerBjörn Gustavsson <[email protected]>2016-10-28 10:10:22 +0200
commitf957985dc38034bf49711052ef02c14fa054667a (patch)
treed7ec2dfd3074a05b2dcaf80f26d13b8b79d57133 /lib/compiler/test
parentce0785da10fb5d82ed3b6e93ff82e112f38e75fa (diff)
parent89bf3f5bef9d9f5fb4a0003d6da028900d0f32fc (diff)
downloadotp-f957985dc38034bf49711052ef02c14fa054667a.tar.gz
otp-f957985dc38034bf49711052ef02c14fa054667a.tar.bz2
otp-f957985dc38034bf49711052ef02c14fa054667a.zip
Merge branch 'bjorn/compiler/minor-fixes' into maint
* bjorn/compiler/minor-fixes: Don't copy funs into guards
Diffstat (limited to 'lib/compiler/test')
-rw-r--r--lib/compiler/test/guard_SUITE.erl13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/compiler/test/guard_SUITE.erl b/lib/compiler/test/guard_SUITE.erl
index 6302f82f29..429d6b79e0 100644
--- a/lib/compiler/test/guard_SUITE.erl
+++ b/lib/compiler/test/guard_SUITE.erl
@@ -87,6 +87,7 @@ misc(Config) when is_list(Config) ->
{ok,buf,<<>>} = get_data({o,true,0}, 42, buf),
{ok,buf,<<>>} = get_data({o,false,0}, 0, buf),
error = get_data({o,false,0}, 42, buf),
+
ok.
@@ -343,6 +344,11 @@ complex_semicolon(Config) when is_list(Config) ->
ok = csemi7(#{a=>1}, 3, 3),
ok = csemi7(#{a=>1, b=>3}, 0, 0),
+ %% 8: Make sure that funs cannot be copied into guards.
+ ok = csemi8(true),
+ error = csemi8(false),
+ error = csemi8(42),
+
ok.
csemi1(Type, Val) when is_list(Val), Type == float;
@@ -457,6 +463,13 @@ csemi6(_, _) -> error.
csemi7(A, B, C) when A#{a:=B} > #{a=>1}; abs(C) > 2 -> ok;
csemi7(_, _, _) -> error.
+csemi8(Together) ->
+ case fun csemi8/1 of
+ Typically when Together; Typically, Together -> ok;
+ _ -> error
+ end.
+
+
comma(Config) when is_list(Config) ->
%% ',' combinations of literal true/false.