Erlang/OTP Forums

Author Message

<  Advanced Erlang/OTP  ~  Dialyzer Bug Pattern

Volkert
Posted: Fri Sep 25, 2009 7:13 pm Reply with quote
User Joined: 30 May 2005 Posts: 24 Location: Laufenburg, Germany
Can someone tell me which kind of bug pattern / anomalies are detected by the dialyzer? The documentation is not very expressive here.

Volkert
View user's profile Send private message
Mazen
Posted: Sun Sep 27, 2009 9:48 am Reply with quote
User Joined: 20 Jul 2006 Posts: 164 Location: London
Most common is probably:

Code:
-module(foo).

do() ->
 case bar:do() of
  ok             ->   ok;
  {stop, Reason} ->   ok;
 end.

Code:
-module(bar).
-export([do/0]).

do() ->
 case whatever() of
  {error, Reason} -> {error, Reason}
  _               -> ok
 end.


I.e. function foo:do/0 is calling a function; bar:do and the return value of that function will crash foo:do/0 if it returns the tuple.

Very handy.
View user's profile Send private message
Volkert
Posted: Thu Oct 01, 2009 4:57 am Reply with quote
User Joined: 30 May 2005 Posts: 24 Location: Laufenburg, Germany
Ok, i found a list (in the dialyzer gui menu "warnings" and in the docs). Wink
- match failures
- failing function calls
- bad fun application
- opaqueness violation
- improper list construction
- error handling functions
- functions of no return
- call to unexported functions
- wrong contracts
- wrong contract syntax

Volkert
Volkert wrote:
Can someone tell me which kind of bug pattern / anomalies are detected by the dialyzer? The documentation is not very expressive here.

Volkert
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum