aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/opaque_tests_SUITE_data/src/opaque/opaque_bug3.erl
blob: 71da82a1f67959d37ff7a75e822bb419afc30c01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
%%---------------------------------------------------------------------
%% A test for which the analysis gave wrong results because it did not
%% handle the is_tuple/1 guard properly.
%%---------------------------------------------------------------------

-module(opaque_bug3).

-export([test/1]).

-record(c, {}).

-opaque o() :: 'a' | #c{}.

-spec test(o()) -> 42.

test(#c{} = O) -> t(O).

t(T) when is_tuple(T) -> 42;
t(a) -> gazonk.