dialyxir icon indicating copy to clipboard operation
dialyxir copied to clipboard

Unknown error occurred

Open RaymondLoranger opened this issue 2 years ago • 3 comments

Erlang/OTP 26 [erts-14.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns] Elixir 1.16.1 (compiled with Erlang/OTP 26) Dialyxir 1.4.3

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/hangman/engine.ex:78: Invalid type specification for function 'Elixir.Hangman.Engine':make_move/2. The success typing is 'Elixir.Hangman.Engine':make_move(binary(),binary()) -> any() But the spec is 'Elixir.Hangman.Engine':make_move('Elixir.Hangman.Game':name(),'Elixir.Hangman.Game':letter()) -> 'Elixir.Hangman.Game':tally() They do not overlap in the 2nd argument


done (warnings were emitted) Halting VM with exit status 2

RaymondLoranger avatar Feb 26 '24 03:02 RaymondLoranger

Initially, module Hangman.Game had letter defined as String.codepoint() and I had no error messages. But then I changed the type to byte and it caused this error message.

RaymondLoranger avatar Feb 26 '24 14:02 RaymondLoranger

@RaymondLoranger is there a repo I can use to reproduce the issue?

jeremyjh avatar Mar 08 '24 16:03 jeremyjh

Hi Jeremy,

Yes, there is a repo (it is a hex package): https://hex.pm/packages/hangman_game

To reproduce the issue you would need to replace lib/hangman/game.ex:22 from

@type letter :: <<_::8>>

to

@type letter :: byte

Regards,

Raymond

From: Jeremy Huffman @.> Sent: Friday, March 8, 2024 11:23 AM To: jeremyjh/dialyxir @.> Cc: Raymond Loranger @.>; Mention @.> Subject: Re: [jeremyjh/dialyxir] Unknown error occurred (Issue #533)

@RaymondLoranger https://github.com/RaymondLoranger is there a repo I can use to reproduce the issue?

— Reply to this email directly, view it on GitHub https://github.com/jeremyjh/dialyxir/issues/533#issuecomment-1985995271 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAZL5CL762YDJGYUQSSMSDYXHQX7AVCNFSM6AAAAABDZNO47KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVHE4TKMRXGE . You are receiving this because you were mentioned.Message ID: @.***>

RaymondLoranger avatar Mar 09 '24 13:03 RaymondLoranger