Actions
Bug #6172
closedInconsistent behaviour of defined?
Description
Following behavior is obvious:
irb(main):004:0> Object.const_get("Misio")
NameError: uninitialized constant Misio
from (irb):4:in const_get' from (irb):4 from /Users/pawel/.rbenv/versions/1.9.4-dev/bin/irb:12:in
'
irb(main):005:0> Object.const_get(Misio)
NameError: uninitialized constant Misio
from (irb):5
from /Users/pawel/.rbenv/versions/1.9.4-dev/bin/irb:12:in `'
Both cases throws an exception, obviously with different backtrace because execution paths are different.
But following behavior is doesn't make sens at all for:
irb(main):001:0> defined?(Object.const_get(Misio))
=> nil
irb(main):002:0> defined?(Object.const_get("Misio"))
=> "method"
Shouldn't defined?(Object.const_get("Misio")) return also nil ?
Actions
Like0
Like0