beatrichartz/csv

Dialyzer error for decode and decode!

AntoineAugusti opened this issue · 3 comments

Relevant lines

csv/lib/csv.ex

Line 156 in 29bc8b7

@spec decode(Enumerable.t(), [decode_options() | {:redact_errors, boolean()}]) :: Enumerable.t()

csv/lib/csv.ex

Line 291 in 29bc8b7

@spec decode!(Enumerable.t(), [decode_options() | {:unredact_exceptions, boolean()}]) ::

Problem

At the moment the following code

CSV.decode([body], separator: separator, redact_errors: false)

will throw a Dialyzer error for no_return because the spec doesn't match. The current code expects decode_options() OR {:redact_errors, boolean()}.

I'm not sure how to "extend" typespec with additional arguments or if you want to do another refactor.

Thanks for reporting, I'll address this soon

This has been addressed in 3.2.1 - please reopen if you still encounter issues.

Thanks! Fixed in 85baadb