code-corps / code-corps-api

Elixir/Phoenix API for Code Corps.
https://www.codecorps.org
MIT License
235 stars 86 forks source link

Fix dialyzer errors #1369

Closed joshsmith closed 6 years ago

joshsmith commented 6 years ago

Problem

As of this writing, we have the following dialyzer errors:

lib/code_corps/emails/message_initiated_by_project_email.ex:14: Invalid type specification for function 'Elixir.CodeCorps.Emails.MessageInitiatedByProjectEmail':create/2. The success typing is (#{'__struct__':='Elixir.CodeCorps.Message', 'project':=#{'__struct__':='Elixir.CodeCorps.Project', 'title':=_, _=>_}, _=>_},#{'__meta__':=_, '__struct__':='Elixir.CodeCorps.Conversation', 'conversation_parts':=_, 'id':=_, 'inserted_at':=_, 'message':=_, 'message_id':=_, 'read_at':=_, 'status':=_, 'updated_at':=_, 'user':=#{'__struct__':='Elixir.CodeCorps.User', 'email':=_, 'first_name':=_, _=>_}, 'user_id':=_}) -> #{'__struct__':='Elixir.Bamboo.Email', 'assigns':=#{atom()=>_}, 'bcc':=_, 'cc':=_, 'from':=_, 'headers':=#{binary()=>binary()}, 'html_body':='nil' | binary(), 'private':=#{atom()=>_}, 'subject':='nil' | binary(), 'text_body':='nil' | binary(), 'to':=_}
lib/code_corps/policy/conversation_part.ex:41: Function authorize/2 has no local return
lib/code_corps/policy/conversation_part.ex:42: The pattern _conversation@1 = #{'__struct__':='Elixir.CodeCorps.Conversation'} can never match the type #{'__meta__':=_, '__struct__':='Elixir.CodeCorps.Message', 'author':=_, 'author_id':=_, 'body':=_, 'conversations':=_, 'id':=_, 'initiated_by':=_, 'inserted_at':=_, 'project':=_, 'project_id':=_, 'subject':=_, 'updated_at':=_}
lib/code_corps/policy/conversation_part.ex:54: Function 'conversation_target?'/2 will never be called
lib/code_corps_web/controllers/conversation_part_controller.ex:37: The pattern _conversation_part@1 = #{'__struct__':='Elixir.CodeCorps.ConversationPart'} can never match the type #{'__meta__':=_, '__struct__':='Elixir.CodeCorps.Conversation', 'conversation_parts':=_, 'id':=_, 'inserted_at':=_, 'message':=_, 'message_id':=_, 'read_at':=_, 'status':=_, 'updated_at':=_, 'user':=_, 'user_id':=_}

Didn't we add something that makes builds fail on these errors @asummers?