-
-
Save senny/9864a138defa322ed807 to your computer and use it in GitHub Desktop.
Ruby 2.2.1 bug
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
$ ruby --version | |
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14] |
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
class Person | |
def implicit | |
nope rescue nil | |
public_send "nope" | |
end | |
def implicit_assignment | |
nope rescue nil | |
public_send "nope=" | |
end | |
def method_missing(*args) | |
super | |
end | |
end | |
a = Person.new | |
a.implicit | |
# test.rb:13:in `method_missing': undefined method `nope' for #<Person:0x007fbad285f4c8> (NoMethodError) | |
# from test.rb:9:in `public_send' | |
# from test.rb:9:in `implicit' | |
# from test.rb:18:in `<main>' | |
a.implicit_assignment | |
# test.rb:13:in `method_missing': undefined local variable or method `nope=' for #<Person:0x007f91d1052ef8> (NameError) | |
# from test.rb:4:in `public_send' | |
# from test.rb:4:in `implicit_assignment' | |
# from test.rb:24:in `<main>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment