aboutsummaryrefslogblamecommitdiffstats
path: root/lib/dialyzer/test/opaque_tests_SUITE_data/src/opaque/opaque_bug3.erl
blob: 71da82a1f67959d37ff7a75e822bb419afc30c01 (plain) (tree)


















                                                                       
%%---------------------------------------------------------------------
%% 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.