[erlang-questions] dialyzer: the pattern ... can never match the type 100

Niclas Eklund nick@REDACTED
Fri Oct 3 15:52:51 CEST 2008


Hello!

Change from:

new_side_pot(Pot = #side_pot{}) ->

to:

new_side_pot(#side_pot{} = Pot) ->

/Niclas @ Erlang/OTP

On Fri, 3 Oct 2008, Joel Reymont wrote:

> Any suggestions on how to fix this?
>
> pot.erl:28: The pattern Pot = {'side_pot', _, _} can never match the
> type 100
>
> 	Thanks, Joel
>
> ---
>
> -record(side_pot, {
> 	  members,
> 	  all_in
> 	 }).
>
> new_side_pot(AllInAmt, Members) ->
>     #side_pot{
>       all_in = AllInAmt,
>       members = Members
>      }.
>
> %% vvv This is what it's complaining about
> new_side_pot(Pot = #side_pot{}) ->
>     new_side_pot(Pot#side_pot.all_in, Pot#side_pot.members);
>
> new_side_pot(AllInAmt)
>   when is_number(AllInAmt) ->
>     new_side_pot(AllInAmt, gb_trees:empty()).
>
> new_side_pot() ->
>     new_side_pot(0, gb_trees:empty()).
>
>
> --
> wagerlabs.com
>
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>




More information about the erlang-questions mailing list