Merged
Conversation
Member
|
Thanks! It might sound strange to say this after I wrote the scenario file, but I’m a bit unsure whether we really need to seriously support END in method, since Ruby shows a warning when it's used. To be precise, I feel like this implementation might not be perfect. That's because END is not executed at the end of the scope, but at the end of the method. def foo
x = nil
1.times do
END { check(x) } # This passes a String (not an Integer)
x = 42
end
x = "str"
endAlso, since END is executed even when exiting via early return or exceptions, if we wanted to handle it accurately, we'd probably need to treat it like an ensure clause. But honestly, I think it is too much. Since you went through the trouble of writing it, I'll merge it for now, but I might remove this handling in the future. Sorry in advance if that happens! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes PostExecutionNode so that it can be evaluated in the correct order.
Is
nilthe correct return value for the foo method in the test scenario? If so, fix it.