summaryrefslogtreecommitdiff
path: root/lib/dialyzer/test/behaviour_SUITE_data/src/otp_6221/my_callbacks_correct.erl
blob: 4a08017c846129e99a7c0079503f7a2a87da2f2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
-module(my_callbacks_correct).

-behaviour(my_behaviour).

-export([foo/0]).

-type pair(A,B) :: {A,B}.

-type nested() :: pair(pair(pair(f,f),f),f).

%% This is correctly implemented, but a combination of Dialyzer
%% "simplification" logic and subtyping rules for behaviours means
%% this implementation has historically been erroneously rejected
-spec foo() -> #{ nested() => x }.
foo() ->
    Ret = #{ {{{f,f}, f}, f} => x },
      Ret.