[erlang-questions] Missing compile warning

Vlad Dumitrescu vladdu55@REDACTED
Fri Feb 28 22:08:03 CET 2014


Hi!

On Fri, Feb 28, 2014 at 7:54 PM, tom kelly <ttom.kelly@REDACTED> wrote:

> -module(no_warn).
> -compile(export_all).
>
> -record(my_rec,{field1, field2}).
>
> my_function1(#my_rec{field1 = {tag, _}, field2 = f2}) -> 1;
> my_function1(#my_rec{field1 = {tag, 1}, field2 = f2}) -> 2; % line 7
> my_function1(_) -> 3.
>
> my_function2(#my_rec{field1 = {tag, _}}) -> 1;
> my_function2(#my_rec{field1 = {tag, 1}}) -> 2; % line11
> my_function2(_) -> 3.
>

Looks like a bug to me, especially since changing the first clause to
my_function1(#my_rec{field1 = {tag, _}, field2 = _}) -> 1;
gives a warning for the first function too.

regards,
Vlad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140228/d5cf05f5/attachment.htm>


More information about the erlang-questions mailing list