Skip to content

Instantly share code, notes, and snippets.

@am-kantox
Last active May 24, 2017 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save am-kantox/92639935429d0dd747159553856e7541 to your computer and use it in GitHub Desktop.
Save am-kantox/92639935429d0dd747159553856e7541 to your computer and use it in GitHub Desktop.
Don’t ask this on interviews!
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