[erlang-questions] [Q] dialyzer message: The pattern X can never match the type Y
Thu May 29 10:03:34 CEST 2008
Per Gustafsson wrote:
> The most likely reason you get a warning like that, which is hard to
> understand is that you have something like this:
> g() ->
> f(Arg) when Arg == foo; Arg == bar; Arg == baz ->
> case Arg of
> foo -> x();
> _ -> y()
> That is you never actually call f/1 with foo and f/1 is not exported.
Ok, this should be it, except that I think the code is actually
executed. Thanks to your explanation, I finally managed to create
a module that reports the warning. It is based on the real module.
Thank you both for your helpful explanations; I am already looking
forward to more enlightenment to come :-)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the erlang-questions