Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialyzer warnings with OTP 19 #1630

Closed
aaronjensen opened this issue Aug 16, 2016 · 0 comments
Closed

Dialyzer warnings with OTP 19 #1630

aaronjensen opened this issue Aug 16, 2016 · 0 comments

Comments

@aaronjensen
Copy link
Contributor

Brand new phoenix app created with mix phoenix.new on OTP 19 has these warnings.

Here's a repro app: https://github.com/aaronjensen/dialyzer_repro

Irrelevant warnings are omitted. Originally reported at phoenixframework/phoenix#1872

Starting Dialyzer
dialyzer --no_check_plt --plt /Users/aaronjensen/.dialyxir_core_19_1.3.2.plt -Wunmatched_returns -Werror_handling -Wrace_conditions -Wunderspecs /Users/aaronjensen/Source/dialyzer_repro/_build/dev/lib/dialyzer_repro/ebin
  Proceeding with analysis...
repo.ex:2: The inferred type for the 1st argument of insert_or_update/2 (#{'__struct__':='Elixir.Ecto.Changeset', 'data':=#{'__meta__':=#{'state':=_, _=>_}, _=>_}, 'valid?'=>boolean(), _=>_}) is not a supertype of #{'__struct__':='Elixir.Ecto.Changeset', 'action':='delete' | 'insert' | 'nil' | 'replace' | 'update', 'changes':=#{atom()=>_}, 'constraints':=[#{'constraint':=binary(), 'field':=atom(), 'match':='exact' | 'suffix', 'message':={binary(),[{atom(),_}]}, 'type':='unique'}], 'data':='nil' | #{'__struct__':=atom()}, 'errors':=[{atom(),{binary(),[{atom(),_}]}}], 'filters':=#{atom()=>_}, 'params':='nil' | #{binary()=>_}, 'prepare':=[fun((#{'__struct__':='Elixir.Ecto.Changeset', 'action':='delete' | 'insert' | 'nil' | 'replace' | 'update', 'changes':=map(), 'constraints':=[any()], _=>_}) -> #{'__struct__':='Elixir.Ecto.Changeset', 'action':='delete' | 'insert' | 'nil' | 'replace' | 'update', 'changes':=map(), 'constraints':=[any()], _=>_})], 'repo':=atom(), 'required':=[atom()], 'types':='nil' | #{atom()=>atom() | {'array',_} | {'embed',#{'__struct__':='Elixir.Ecto.Embedded', 'cardinality':='many' | 'one', 'field':=atom(), 'on_cast':='nil' | fun(), 'on_replace':='delete' | 'mark_as_invalid' | 'raise', 'owner':=atom(), 'related':=atom()}} | {'in',_} | {'map',_}}, 'valid?':=boolean(), 'validations':=[{atom(),_}]}, which is expected type for this argument in the callback of the 'Elixir.Ecto.Repo' behaviour
repo.ex:2: The inferred type for the 1st argument of 'insert_or_update!'/2 (#{'__struct__':='Elixir.Ecto.Changeset', 'data':=#{'__meta__':=#{'state':=_, _=>_}, _=>_}, 'valid?'=>boolean(), _=>_}) is not a supertype of #{'__struct__':='Elixir.Ecto.Changeset', 'action':='delete' | 'insert' | 'nil' | 'replace' | 'update', 'changes':=#{atom()=>_}, 'constraints':=[#{'constraint':=binary(), 'field':=atom(), 'match':='exact' | 'suffix', 'message':={binary(),[{atom(),_}]}, 'type':='unique'}], 'data':='nil' | #{'__struct__':=atom()}, 'errors':=[{atom(),{binary(),[{atom(),_}]}}], 'filters':=#{atom()=>_}, 'params':='nil' | #{binary()=>_}, 'prepare':=[fun((#{'__struct__':='Elixir.Ecto.Changeset', 'action':='delete' | 'insert' | 'nil' | 'replace' | 'update', 'changes':=map(), 'constraints':=[any()], _=>_}) -> #{'__struct__':='Elixir.Ecto.Changeset', 'action':='delete' | 'insert' | 'nil' | 'replace' | 'update', 'changes':=map(), 'constraints':=[any()], _=>_})], 'repo':=atom(), 'required':=[atom()], 'types':='nil' | #{atom()=>atom() | {'array',_} | {'embed',#{'__struct__':='Elixir.Ecto.Embedded', 'cardinality':='many' | 'one', 'field':=atom(), 'on_cast':='nil' | fun(), 'on_replace':='delete' | 'mark_as_invalid' | 'raise', 'owner':=atom(), 'related':=atom()}} | {'in',_} | {'map',_}}, 'valid?':=boolean(), 'validations':=[{atom(),_}]}, which is expected type for this argument in the callback of the 'Elixir.Ecto.Repo' behaviour
repo.ex:2: Function rollback/1 has no local return
repo.ex:2: The inferred type for the 1st argument of 'update!'/2 (#{'__struct__':='Elixir.Ecto.Changeset', 'action':=_, 'repo':=_, 'valid?':=boolean(), _=>_}) is not a supertype of #{'__struct__':=atom()}, which is expected type for this argument in the callback of the 'Elixir.Ecto.Repo' behaviour
 done in 0m3.37s
done (warnings were emitted)
bartekupartek pushed a commit to bartekupartek/ecto that referenced this issue Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant