summaryrefslogtreecommitdiff
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <bjorn@erlang.org>2022-11-24 07:45:11 +0100
committerBjörn Gustavsson <bjorn@erlang.org>2022-11-26 07:25:40 +0100
commit70096d80493247a39de8b3810f28a67e4ebe149a (patch)
tree0877fa70ac0e331c174ab437556c4b0fc2620eb1 /lib/stdlib/test
parent8759614cdf0ceefc7ad7523b9b6ddd5e10b98694 (diff)
downloaderlang-70096d80493247a39de8b3810f28a67e4ebe149a.tar.gz
Fix compiler crash when using a record as LC filter
Closes #6501
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/erl_expand_records_SUITE.erl16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/stdlib/test/erl_expand_records_SUITE.erl b/lib/stdlib/test/erl_expand_records_SUITE.erl
index c48a1ac90e..ea5cc4a354 100644
--- a/lib/stdlib/test/erl_expand_records_SUITE.erl
+++ b/lib/stdlib/test/erl_expand_records_SUITE.erl
@@ -148,6 +148,22 @@ expr(Config) when is_list(Config) ->
is_record(_, _, _) ->
error(wrong_is_record).
+ ">>,
+ <<"
+ -record(foo, {bar = [Bar || Bar <- ?MODULE:id([]), size(Bar) > 0]}).
+
+ t() ->
+ {'EXIT',{{bad_filter,{foo,[]}},[_|_]}} = catch gh6501a(whatever),
+ [whatever] = gh6501b(whatever),
+ ok.
+
+ gh6501a(Bar) ->
+ [Bar || #foo{}].
+
+ gh6501b(Bar) ->
+ [Bar || is_tuple(#foo{})].
+
+ id(I) -> I.
">>
],