diff options
author | Erlang/OTP <[email protected]> | 2016-07-14 11:22:30 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2016-07-14 11:22:30 +0200 |
commit | 0076aef1e9c531389050b947fe09d6d7ebe6f2e4 (patch) | |
tree | 03f3b2d069a91bb667f5f4cb4df1821a31788f56 /lib/stdlib | |
parent | 0573efbc18fc20f8646cf3ff64d2affd06e03cb8 (diff) | |
parent | 9f9bf4a6db455575d68eba4850c76341b08614d6 (diff) | |
download | otp-0076aef1e9c531389050b947fe09d6d7ebe6f2e4.tar.gz otp-0076aef1e9c531389050b947fe09d6d7ebe6f2e4.tar.bz2 otp-0076aef1e9c531389050b947fe09d6d7ebe6f2e4.zip |
Merge branch 'hasse/stdlib/fix_shell_records/ERL-182/OTP-13719' into maint-19
* hasse/stdlib/fix_shell_records/ERL-182/OTP-13719:
stdlib: Correct a bug regarding records in the shell
Diffstat (limited to 'lib/stdlib')
-rw-r--r-- | lib/stdlib/src/shell.erl | 4 | ||||
-rw-r--r-- | lib/stdlib/test/shell_SUITE.erl | 17 |
2 files changed, 18 insertions, 3 deletions
diff --git a/lib/stdlib/src/shell.erl b/lib/stdlib/src/shell.erl index 82a3a2be4f..28f37ef8bf 100644 --- a/lib/stdlib/src/shell.erl +++ b/lib/stdlib/src/shell.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2015. All Rights Reserved. +%% Copyright Ericsson AB 1996-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -768,6 +768,8 @@ used_records({call,_,{atom,_,record_info},[A,{atom,_,Name}]}) -> {name, Name, A}; used_records({call,Line,{tuple,_,[M,F]},As}) -> used_records({call,Line,{remote,Line,M,F},As}); +used_records({type,_,record,[{atom,_,Name}|Fs]}) -> + {name, Name, Fs}; used_records(T) when is_tuple(T) -> {expr, tuple_to_list(T)}; used_records(E) -> diff --git a/lib/stdlib/test/shell_SUITE.erl b/lib/stdlib/test/shell_SUITE.erl index dc82e92876..c409a6949b 100644 --- a/lib/stdlib/test/shell_SUITE.erl +++ b/lib/stdlib/test/shell_SUITE.erl @@ -30,7 +30,7 @@ progex_bit_syntax/1, progex_records/1, progex_lc/1, progex_funs/1, otp_5990/1, otp_6166/1, otp_6554/1, - otp_7184/1, otp_7232/1, otp_8393/1, otp_10302/1]). + otp_7184/1, otp_7232/1, otp_8393/1, otp_10302/1, otp_13719/1]). -export([ start_restricted_from_shell/1, start_restricted_on_command_line/1,restricted_local/1]). @@ -91,7 +91,7 @@ groups() -> progex_funs]}, {tickets, [], [otp_5990, otp_6166, otp_6554, otp_7184, - otp_7232, otp_8393, otp_10302]}]. + otp_7232, otp_8393, otp_10302, otp_13719]}]. init_per_suite(Config) -> Config. @@ -2810,6 +2810,19 @@ otp_10302(Config) when is_list(Config) -> test_server:stop_node(Node), ok. +otp_13719(Config) when is_list(Config) -> + Test = <<"-module(otp_13719). + -record(bar, {}). + -record(foo, {bar :: #bar{}}).">>, + File = filename("otp_13719.erl", Config), + Beam = filename("otp_13719.beam", Config), + ok = compile_file(Config, File, Test, []), + RR = "rr(\"" ++ Beam ++ "\"). #foo{}.", + "[bar,foo]\n#foo{bar = undefined}.\n" = t(RR), + file:delete(filename("test.beam", Config)), + file:delete(File), + ok. + scan(B) -> F = fun(Ts) -> case erl_parse:parse_term(Ts) of |