Im getting this error from dialyzer “The pattern can never match the type.”
Here’s some sample code
@spec check_rating_to_play(any(), any()) :: :ok | {:error, String.t()}
def check_rating_to_play(user_id, consul_state) do
@spec check_rank_to_play(any(), any()) :: :ok | {:error, String.t()}
def check_rank_to_play(user, consul_state) do
This function is called like this
rating_check_result = LobbyRestrictions.check_rating_to_play(userid, state)
rank_check_result = LobbyRestrictions.check_rank_to_play(user, state)
cond do
rating_check_result != :ok ->
# Send message
{_, msg} = rating_check_result
CacheUser.send_direct_message(get_coordinator_userid(), userid, msg)
false
rank_check_result != :ok ->
# Send message
{_, msg} = rank_check_result
CacheUser.send_direct_message(get_coordinator_userid(), userid, msg)
false
Is dialyzer saying that the first condition is always true? I’m confused.