aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stdlib')
-rw-r--r--lib/stdlib/src/io_lib.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/stdlib/src/io_lib.erl b/lib/stdlib/src/io_lib.erl
index e90cda0533..24ae83da9c 100644
--- a/lib/stdlib/src/io_lib.erl
+++ b/lib/stdlib/src/io_lib.erl
@@ -296,8 +296,8 @@ write(T, D) when is_tuple(T) ->
write_tail(tl(tuple_to_list(T)), D-1, $,)],
$}]
end;
-%write(Term, D) when is_map(Term) -> write_map(Term, D);
-write(Term, D) -> write_map(Term, D).
+write(Term, D) when is_map(Term) -> write_map(Term, D);
+write(Term, D) -> write_hashmap(Term, D).
%% write_tail(List, Depth, CharacterBeforeDots)
%% Test the terminating case first as this looks better with depth.
@@ -315,6 +315,9 @@ write_port(Port) ->
write_ref(Ref) ->
erlang:ref_to_list(Ref).
+write_hashmap(Map,D) ->
+ ["#{", write_map_body(hashmap:to_list(Map),D), $}].
+
write_map(Map, D) when is_integer(D) ->
[$#,${,write_map_body(maps:to_list(Map), D),$}].