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

False negative on "unused return values" ? #36

Closed
kbaird opened this issue Feb 1, 2016 · 3 comments
Closed

False negative on "unused return values" ? #36

kbaird opened this issue Feb 1, 2016 · 3 comments

Comments

@kbaird
Copy link

kbaird commented Feb 1, 2016

Hi. The code at photomattmills/ecto_neo4j#4 reports a warning:

[W] ↗ There should be no unused return values for Enum.map().lib/ecto_neo4j.ex:61:15 (Ecto.Neo4j.sort_column)

That I believe is incorrect. The context is a value returned from an if check being the last evaluated expression in a function:

    if hd(cols) do
      coercer = fn({name, type}) -> coerce(type, col[Atom.to_string(name)]) end 
      cols |> Enum.map(coercer)
    else
      [nil]
    end

It looks like the presence of the [nil] and end lines below the Enum.map/2 is confusing it into thinking that there are additional expressions leading the map value to be discarded.

@rrrene
Copy link
Owner

rrrene commented Feb 1, 2016

Thanks for reporting this, it indeed looks like a bug! 👍

I will look into it!

rrrene added a commit that referenced this issue Feb 1, 2016
rrrene added a commit that referenced this issue Feb 1, 2016
These reproduce bugs discovered while researching the reasons for #36
@rrrene rrrene closed this as completed in 801876d Feb 1, 2016
@rrrene
Copy link
Owner

rrrene commented Feb 1, 2016

Bugfix is live in v0.2.6 - Thanks again Kevin for a comprehensive bug report. Open Source at its best! 👍

@kbaird
Copy link
Author

kbaird commented Feb 1, 2016

Thanks for such a quick fix.

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