Strange warnings when `use`ing ok_jose library

Hey,

I started to play around with the ok_jose library in a project, and when I compile the code I get these warnings:

warning: this clause cannot match because a previous clause at line 73 always matches
Warning: lib/projx/sessions/schemas/session.ex:145

warning: this clause cannot match because a previous clause at line 73 always matches
Warning: lib/projx/sessions/schemas/session.ex:158

warning: this clause cannot match because a previous clause at line 73 always matches
Warning: lib/projx/sessions/transcripts.ex:195

The lines it is pointing to is where I have |> Pipe.ok(),
but where it says the previous clause is, there is nothing, in one file comments for example, other completely other function.
If I remove |> Pipe.ok() the warning goes away.
if I remove the use OkJose the warnings go away as well, but that results in new problems.

I am on elixir:1.13.1

Any ideas?

I also tried this in a new empty project, but no issues there for now.

Thanks

It seems Pipe.ok compiles to a case statement of some sort: https://github.com/vic/ok_jose/blob/2840d629a47bb7ed1f0339e422b571671639d468/lib/ok_jose/def_pipe.ex so I assume it has clauses that are ordered badly or something similar.

In fact I see there has been a similar problem earlier also: https://github.com/vic/ok_jose/issues/1

1 Like

Yeah, I decided due to time constraint to switch to https://github.com/CrowdHailer/OK#ok-pipe for now. Thanks for checking!

1 Like