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

Failed to parse #467

Closed
smt116 opened this issue Aug 29, 2022 · 3 comments
Closed

Failed to parse #467

smt116 opened this issue Aug 29, 2022 · 3 comments

Comments

@smt116
Copy link

smt116 commented Aug 29, 2022

Environment

  • Elixir & Erlang/OTP versions (elixir --version): Elixir 1.13.4 (compiled with Erlang/OTP 23)

  • Which version of Dialyxir are you using? (cat mix.lock | grep dialyxir): 1.2.0

Current behavior

Please file a bug in https://github.com/jeremyjh/dialyxir/issues with this message.

Failed to format warning:
"@spec a({:ok, %{<<100, 97, 116, 97>> => %{<<114, 101, 108, 97, 116, 105, 111, 110, 115, 104, 105, 112, 115>> => %{<<97, 99, 99, 111, 117, 110, 116>> => %{<<108, 105, 110, 107, 115>> => %{<<114, 101, 108, 97, 116, 101, 100>> => <<47, 118, 50, 47, 97, 99, 99, 111, 117, 110, 116, 115, 47, _account_id@1/binary>>}}}}}}) :: :ok\ndef a() do\n  :ok\nend\n"


Legacy warning:
lib/[filtered]/resources/counterparty.ex:43: The pattern {'ok', #{<<100,97,116,97>>:=#{<<114,101,108,97,116,105,111,110,115,104,105,112,115>>:=#{<<97,99,99,111,117,110,116>>:=#{<<108,105,110,107,115>>:=#{<<114,101,108,97,116,101,100>>:=<<47,118,50,47,97,99,99,111,117,110,116,115,47,_account_id@1/binary>>}}}}}} can never match the type {'error',_} | {'ok',#{'__client__':=#{'__struct__':='Elixir.Tesla.Client', 'adapter':='nil' | {_,_} | {_,_,_}, 'fun':=_, 'post':=[any()], 'pre':=[any()]}, '__module__':=atom(), '__struct__':='Elixir.Tesla.Env', 'body':=_, 'headers':=[{_,_}], 'method':='delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace', 'opts':=[{_,_}], 'query':=[{_,_}], 'status':='nil' | integer(), 'url':=binary()}}
@epinault
Copy link

same for OTP26 and 1.15

Please file a bug in https://github.com/jeremyjh/dialyxir/issues with this message.
Unknown error occurred: %FunctionClauseError{module: Dialyxir.Warnings.InvalidContract, function: :format_long, arity: 1, kind: nil, args: nil, clauses: nil}
Legacy warning:
lib/halberd_client/http_client.ex:10: Invalid type specification for function 'Elixir.HalberdClient.HTTPClient':get/2.
 The success typing is 'Elixir.HalberdClient.HTTPClient':get(binary(),'nil' | maybe_improper_list() | map()) -> {'error',_} | {'ok',#{'__client__':=#{'__struct__':='Elixir.Tesla.Client', 'adapter':='nil' | {_,_} | {_,_,_}, 'fun':=_, 'post':=[any()], 'pre':=[any()]}, '__module__':=atom(), '__struct__':='Elixir.Tesla.Env', 'body':=_, 'headers':=[{_,_}], 'method':='delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace', 'opts':=[{_,_}], 'query':=[{_,_}], 'status':='nil' | integer(), 'url':=binary()}}
 But the spec is 'Elixir.HalberdClient.HTTPClient':get('Elixir.Tesla.Env':url(),'Elixir.Tesla':option()) -> 'Elixir.Tesla.Env':result()
 They do not overlap in the 2nd argument

@jeremyjh , any idea?

@jeremyjh
Copy link
Owner

jeremyjh commented Nov 4, 2023

@epinault that's a completely different error, please open a new issue and include a link to a repo that I could reproduce it with if possible.

@jeremyjh jeremyjh closed this as completed Nov 4, 2023
@epinault
Copy link

epinault commented Nov 8, 2023

unfortunately code is private code . Would need to figure out how I can abstract code and repo that situation then. I ll opena. new issue and see if I can provide a repro case

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

3 participants