aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/opaque_SUITE_data/src/ets/ets_use.erl
blob: 4eb202f16a8ee18b81fae99b4c432d4ea64b8337 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-module(ets_use).
-export([t1/0, t2/0, t3/0, t4/0]).

t1() ->
    case n() of
	T when is_atom(T) -> atm;
	T when is_integer(T) -> int
    end.

t2() ->
    case n() of
	T when is_integer(T) -> int;
	T when is_atom(T) -> atm
    end.

t3() ->
    is_atom(n()). % no warning since atom() is possible

t4() ->
    is_integer(n()). % opaque warning since tid() is opaque

n() -> ets:new(n, [named_table]). % -> atom() | tid()