[erlang-bugs] dialyzer typename/0 and typename/1 names are treated the same?
ノートン ジョーセフ ウェイ ン
norton@REDACTED
Tue Jan 22 04:28:05 CET 2013
Given the sample module below, dialyzer reports that f_datum is already defined.
This behaviour is strange to me because I'm expecting f_datum/0 and f_datum/1 to be treated as two independent types. Is this a bug or specification?
thanks,
Joe N.
NG case:
$ dialyzer --src --plt ~/.dialyzer_plt.R15B03 src/foobar.erl
Checking whether the PLT /Users/norton/.dialyzer_plt.R15B03 is up-to-date... yes
Proceeding with analysis...
dialyzer: Analysis failed with error:
Could not scan the following file(s): [{"/Users/norton/appfoobar/src/foobar.erl",
"Type f_datum already defined\n"}]
Last messages in the log cache:
Reading files and computing callgraph…
$ cat src/foobar.erl
-module(foobar).
-type foo() :: foo.
-type bar(T) :: list(T).
-type f_datum(T) :: foo() | bar(T).
-type f_datum() :: f_datum(f_datum()).
OK case:
$ dialyzer --src --plt ~/.dialyzer_plt.R15B03 src/foobar.erl
Checking whether the PLT /Users/norton/.dialyzer_plt.R15B03 is up-to-date... yes
Proceeding with analysis... done in 0m26.28s
done (passed successfully)
$ cat src/foobar.erl
-module(foobar).
-type foo() :: foo.
-type bar(T) :: list(T).
-type f_datum(T) :: foo() | bar(T).
-type f_datums() :: f_datum(f_datums()).
Erlang/OTP version info:
$ erl -v
Erlang R15B03 (erts-5.9.3.1) [source] [64-bit] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.9.3.1 (abort with ^G)
1>
More information about the erlang-bugs
mailing list