Skip to content

Instantly share code, notes, and snippets.

@takaokouji
Created March 16, 2011 12:40
Show Gist options
  • Save takaokouji/872416 to your computer and use it in GitHub Desktop.
Save takaokouji/872416 to your computer and use it in GitHub Desktop.
Could not find the constant in class_eval.
module A
B = 10
def f
class_eval { B }
end
end
class K
extend A
f
end
__END__
$ macruby test_include.rb
test_include.rb:4:in `f': uninitialized constant K::B (NameError)
from test_include.rb:10:in `block'
from test_include.rb:8:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment