Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # so, we had a bug from a line of code doing this:
- something_that_may_be_symbol_or_str.to_s +"something"
- # => undefined method `+@' for "something":String
- # TIL:
- Derp = Class.new { def +@; puts 'WAT'; end }
- # => Derp
- +Derp.new
- # => WAT
- # but what is really weird is:
- derp = 'hi'
- # => "hi"
- derp +'hi'
- # => "hihi"
- derp.to_s +'hi'
- # => NoMethodError: undefined method `+@' for "hi":String
Add Comment
Please, Sign In to add comment