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
Improve error reporting: warning if returning ignore #1113
Comments
What's wrong with it? The fact that we don't ignore anything? And what is
|
@forki, added the error message. What is wrong is that the function signature in this case turns into Try to put a NUnit test such as this one and to run it, I think I've seen this mistake few times when someone is not used to the pipe operator. Of course if people think it is a stupid warning we can forget about it 😄 |
so in other words you meant to return I guess this is the same as returning a function in any function - is what we're saying is "should we return a warning any time you return a function"? Can't be. Is |
@isaacabraham intent is to just make that happen for |
@smoothdeveloper I wonder if this would be better off as part of FSharpLint instead? |
Yes this one looks too specific to "ignore" - I don't think we can bake that easily into the compiler. I mean there is probably a way, but it feels like this one should go into linter. |
Or maybe it can go into nunit. The runner could complain if it finds tests with wrong signature |
@ReedCopsey / @forki makes sense, I'll see if I can make a contribution to FSharpLint thanks! |
When beginning with F# (or when exhausted), it can happen to be writing code which mistakenly returns
ignore
such as:I think this is in many case unintended and warrants a warning.
Did you intend to return 'ignore' or to use it to discard previous expression?
#1103
The text was updated successfully, but these errors were encountered: