Last active
May 24, 2017 09:43
-
-
Save am-kantox/92639935429d0dd747159553856e7541 to your computer and use it in GitHub Desktop.
Don’t ask this on interviews!
This file contains 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
def a1 | |
:normal | |
ensure | |
:ensure | |
end | |
def a2 | |
return :normal | |
ensure | |
return :ensure | |
end | |
def a3 | |
:normal | |
finally | |
:finally | |
end | |
def a4 | |
return :normal | |
finally | |
return :finally | |
end | |
[ | |
(a1 rescue :raised), | |
(a2 rescue :raised), | |
(a3 rescue :raised), | |
(a4 rescue :raised) | |
] | |
#⇒ ??? | |
################################# | |
## FWIW, the correct answer is ## | |
## 165 empty LOCs below ## | |
################################# | |
[:normal, :ensure, :raised, :normal] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment