-module(test).
-export([f/0, g/0]).
-spec f() -> RESULT when
RESULT :: 0..12 .
-spec g() -> RESULT when
RESULT :: 0..13 .
f() -> 100 .
g() -> 100 .
実行中の透析装置(およびタイパー)は、機能f
のみが捕捉されます。Erlang Dialyzer整数範囲
dialyzer test.erl
Checking whether the PLT /Users/ben/.dialyzer_plt is up-to-date... yes
Proceeding with analysis...
test.erl:4: Invalid type specification for function test:f/0. The success typing is() -> 100
done in 0m0.53s
done (warnings were emitted)
タイパー
typer test.erl
typer: Error in contract of function test:f/0
The contract is:() -> RESULT when RESULT :: 0..12
but the inferred signature is:() -> 100
と同じことが、この "期待される" 行動ですか?