Skip to content

Instantly share code, notes, and snippets.

@lukaszkorecki
Created February 19, 2010 13:39
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 lukaszkorecki/308699 to your computer and use it in GitHub Desktop.
Save lukaszkorecki/308699 to your computer and use it in GitHub Desktop.
# 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