another bounds example - catched by normal compile but not by dialyzer

Roger Larsson roger.larsson@REDACTED
Tue Jun 27 09:16:13 CEST 2006

Furter experimentation:
* Static checking of array bounds is a simpler problem than handling dynamic 
So, lets try the same kind of errors with tuples.

Normal compile detects these simple cases. But dialyzer
return some strange messages.
At least the dialyzer output is hard to decipher...

	-export([detect/0, wrong_match/0]).

	detect() -> element(4, {1, 2, 3}).
	wrong_match() -> {_, _, _, _} = {1, 2, 3}.

> erl
1> c(bounds).
./bounds.erl:4: Warning: this expression would cause a 'badarg' exception at 
./bounds.erl:5: Warning: this clause cannot match because of different 

> dialyzer (from source)
{bounds,detect,0}: Function has no local return
{bounds,wrong_match,0}: Function has no local return


More information about the erlang-questions mailing list