Created
February 19, 2010 13:39
-
-
Save lukaszkorecki/308699 to your computer and use it in GitHub Desktop.
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
# Works on: ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9.8.0] (installed using rvm) | |
# Fails on: ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-darwin9] (installed using macports) | |
def caller &block | |
block.call | |
end | |
class Base | |
def method_missing meth | |
puts "#{meth} called on Base" | |
end | |
end | |
class Child < Base | |
def foo | |
caller {super()} # this fails on newer version | |
# 1.times { super() } | |
end | |
end | |
c = Child.new | |
c.foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment