aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/small_SUITE_data/src/no_unused_fun.erl
blob: 0bd8ba402ca31cb192a0204acb5e305f2645acd7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-module(no_unused_fun).
-export([main/2]).

main(X, Bool) ->
  case Bool of
    true ->
      F = fun foo/1;
    false ->
      F = fun foobar/1
  end,
  calc(X, F).

calc(X, Fun) ->
  Fun(X).

foo(A) ->
  A+42.

foobar(A) ->
  A-42.