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

Joel Reymont <>
Fri Oct 3 15:29:03 CEST 2008


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








More information about the erlang-questions mailing list