Hello there!
When I try to create type product()
, dialyzer reported an error:
===> Error in dialyzing apps: Analysis failed with error:
Unable to find type 'fun'/2
Last messages in the log cache:
Reading files and computing callgraph... done in 0.13 secs
Removing edges... done in 0.00 secs
Full module looks like this:
-module(test_product_app).
-behaviour(application).
-export([start/2, stop/1, test/0]).
-type product() :: binary().
start(_StartType, _StartArgs) ->
test_product_sup:start_link().
stop(_State) ->
ok.
-spec test() -> Result when
Result :: product().
test() ->
<<"123">>.
If I remove -spec
for function test
, then error not reproduced.
I use Erlang/OTP 26.0.2 on Debian 10 with rebar3 v. 3.22.1
Anybody knows is it bug in dialyzer or I use it wrong?