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 error for decode and decode! #125

Closed
AntoineAugusti opened this issue Nov 8, 2023 · 3 comments
Closed

Dialyzer error for decode and decode! #125

AntoineAugusti opened this issue Nov 8, 2023 · 3 comments

Comments

@AntoineAugusti
Copy link

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.

@beatrichartz
Copy link
Owner

Thanks for reporting, I'll address this soon

@beatrichartz
Copy link
Owner

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

@AntoineAugusti
Copy link
Author

Thanks! Fixed in 85baadb

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

2 participants