blob: c24cf3ea81e6be8f471ae9ccdd55e67b8baf3ccc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
%% See also ERL-593.
-module(unused_funs).
-export([test/0]).
test() -> % "has no local return"
Var = outer_scope,
case other_error of
error -> % "can never match"
%% No warnings "no local return" and "_ = 1 can never match 0" (!)
foo(fun() -> {Var, 1 = 0} end)
end.
not_used() -> % "will never be called"
%% No warnings "no local return" and "1 can never match 0".
foo(fun() -> 1 = 0 end).
foo(Fun) -> % "will never be called"
1 = 0, % No pattern match warning (foo/1 is not traversed at all).
Fun().
|