You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

为何Dialyzer仅检查Erlang函数的第一个分支?

为何Dialyzer仅检查函数的第一个分支?

代码示例1

-spec f(integer()) -> integer().
f(0) -> 0;
f(_) -> test.

分析过程及结果:

正在分析... 分析完成,耗时0m0.25s
分析通过

使用case表达式的版本

-spec f(integer()) -> integer().
f(N) -> 
    case N of
      0 -> 1;
      _ -> test
    end.

该版本同样能通过Dialyzer检查,所使用的Dialyzer版本为4.4.3。

内容的提问来源于stack exchange,提问作者Владимир Слайковский

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.25 22:57:25