-
Notifications
You must be signed in to change notification settings - Fork 12
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
Static Analysis Glitch #163
Comments
So obviously the static analysis is only counting the number of arguments in the last lambda expression. It's probably too hard in the analysis to try and track which lambda function actually gets returned (it might even be impossible). Probably the best solution is to add an extra check to the analysis to first give an error if there is more than one lambda function defined. It would still cause this answer to be marked wrong even when the code behaves correctly, but the error message would be more accurate. (I'm mostly in favour of this, since the student should be able to recognise and remove the redundant code, especially this late in the semester.) |
I agree - and maybe the question should perhaps say that a single lambda terms is required |
It actually wouldn't be too hard to track which lambda is returned (if the I reckon just error out if there's more than one lambda. (Even a generic I would prefer not to say that a single lambda term is required in the On 25 May 2015 at 09:52, Peter Robinson [email protected] wrote:
|
OK - fair point - making it an error to have code after return would be fine - what about if some_test: |
My proposed fix is to count every lambda expression in the whole function, regardless of return values. So that example should count as two, and give the error "You only need to define one lambda function". |
Static analysis incorrectly detects the following as erroneous (due to erroneous code after return):
The text was updated successfully, but these errors were encountered: