Skip to content

Instantly share code, notes, and snippets.

@Watson1978
Created May 2, 2012 03:19
Show Gist options
  • Select an option

  • Save Watson1978/2573338 to your computer and use it in GitHub Desktop.

Select an option

Save Watson1978/2573338 to your computer and use it in GitHub Desktop.
MacRuby : bug : undef
42.instance_eval{ undef :!= }
p "abc" != 42
@Watson1978

Copy link
Copy Markdown
Author

should not remove the method by "undef" from special const object.

$ macruby test_undef.rb 
/Users/watson/tmp/test_undef.rb:1:in `<main>': undefined method `!=' for "abc":String (NoMethodError)

if remove the method, it seems that also remove the method from NSObject.

@Watson1978

Copy link
Copy Markdown
Author

Expect

$ ruby19 test_undef.rb
test_undef.rb:1:in `block in <main>': no class to undef method (TypeError)
    from test_undef.rb:1:in `instance_eval'
    from test_undef.rb:1:in `<main>'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment