aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/compile_SUITE_data/small_maps.erl
blob: a17a136a7d9bca09581a6cd9cb58d2312d0e0536 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-module(small_maps).

-export([go/0,go/1]).

go() ->
    go(1337).

go(V0) ->
    M0 = #{ a => 1, val => V0},
    V1 = get_val(M0),
    M1 = M0#{ val := [V0,V1] },
    {some_val,[1337,{some_val,1337}]} = get_val(M1),
    ok.

get_val(#{ "wazzup" := _, val := V}) -> V;
get_val(#{ val := V }) -> {some_val, V}.