[erlang-questions] Re: Dialyzer and throw/catch
Gordon Guthrie
gordon@REDACTED
Sun Dec 5 12:32:09 CET 2010
Jachyem
Of course you are right.
> success typing is (string()) -> 'ok' and the contract is
(Format::string())
I had convinced my self that this was what dialyzer through
muin_util:attempt should be returning but on looking at what I pasted in
with fresh eyes this morning it is obvious that I am but a fool...
> (About time I tried dialyzer more closely, it seems
pretty smart ;-)
Oh it is. We used to run it as part of our continuous integration - but on
one upgrade of Erlang it fell into desuetude. So brining out code back to
pristine tip-top form means wading through a lot of dialyser warnings :(
Gordon
On 4 December 2010 21:41, Jachym Holecek <freza@REDACTED> wrote:
> # Gordon Guthrie 2010-12-04:
> > On further investigation is seems the problem might be with the function
> > that is being called. The dialyzer error for it is:
> >
> > muin_util.erl:227: The call
> > error_logger:error_msg({'error',_,[{atom(),atom(),[any()] | byte()}]} |
> > {'throw',_,[{atom(),atom(),[any()] | byte()}]}) will never return since
> the
> > success typing is (string()) -> 'ok' and the contract is
> (Format::string())
> > -> 'ok'
>
> That's right, error_logger:error_msg/1 expects a string argument, but
> you're giving it a 3-tuple -- so dialyzer knows that call is going to
> explode and correctly concludes muin_util:attempt/3 can only possibly
> return {ok, _}. (About time I tried dialyzer more closely, it seems
> pretty smart ;-)
>
> > There is no spec for muin_util:atttempt/3 so I am not sure where this
> > 'success typing' is coming from..
>
> "Success typing" is the name of the approach dialyzer is using, others
> will know more details about it.
>
> Regards,
> -- Jachym
>
--
Gordon Guthrie
CEO hypernumbers
http://hypernumbers.com
t: hypernumbers
+44 7776 251669
More information about the erlang-questions
mailing list