From 70096d80493247a39de8b3810f28a67e4ebe149a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 24 Nov 2022 07:45:11 +0100 Subject: Fix compiler crash when using a record as LC filter Closes #6501 --- lib/stdlib/test/erl_expand_records_SUITE.erl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/stdlib/test') 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. ">> ], -- cgit v1.2.1