Skip to content

Commit

Permalink
Add a nested map creation example to test/should_pass/map_creation.erl
Browse files Browse the repository at this point in the history
The example comes from josefs#378.
  • Loading branch information
erszcz committed Sep 19, 2022
1 parent 37a9b16 commit cac23e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/should_pass/map_creation.erl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-module(map_creation).
-export([f/0, g/0]).
-export([f/0, g/0, h/0]).

-spec f() -> #{apa := bepa}.
f() -> #{apa => bepa}.
Expand All @@ -9,3 +9,6 @@ f() -> #{apa => bepa}.
-spec g() -> typed_map().
g() ->
#{field_a => <<"ala ma kota">>}.

-spec h() -> #{inner := #{a := 5}}.
h() -> #{inner => #{a => 5}}.

0 comments on commit cac23e2

Please sign in to comment.