aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/small_tests_SUITE_data/src/contract2.erl
blob: 83ee5910f2b148e90088afdad2ff1bb610b6cbbc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-module(contract2).
-export([test/2]).

-spec test(list(), list()) -> ok.

test([], []) ->
  ok;
test([], L) ->
  raise(L);
test([H|T], L) ->
  case H of
    true -> test(T, L);
    false -> test(T, [H|L])
  end.

-spec raise(_) -> no_return().
raise(X) -> 
  throw(X).