Skip to content

Instantly share code, notes, and snippets.

@oriolgual
Created October 11, 2011 08:56
Show Gist options
  • Save oriolgual/1277613 to your computer and use it in GitHub Desktop.
Save oriolgual/1277613 to your computer and use it in GitHub Desktop.
Problem with rbx and method.to_proc
Oriols-Mac-Pro:spinach(851m|master!?) $ RBXOPT=-X19 irb
~> Console extensions: wirble hirb ap rails2 rails3 pm interactive_editor blueprints
rbx-head :001 > def foo
rbx-head :002?> 3
rbx-head :003?> end
=> #<Rubinius::CompiledMethod foo file=(irb)>
rbx-head :004 > m = method(:foo)
=> #<Method: Object#foo (defined in Object from "def foo")>
rbx-head :005 > p = proc { 3 }
=> #<Proc:0x3184@(irb):5>
rbx-head :006 > instance_exec(&m.to_proc)
NoMethodError: undefined method `static_scope' on nil:NilClass.
from Kernel(NilClass)#static_scope (method_missing) at kernel/delta/kernel.rb:79
from BasicObject(Object)#instance_exec at kernel/common/eval19.rb:91
from { } in Object#irb_binding at (irb):6
from Rubinius::BlockEnvironment#call_on_instance at kernel/common/block_environment.rb:72
rbx-head :007 > instance_exec(&p)
=> 3
rbx-head :008 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment