L
Lionel Thiry
Hello!
A lot explore the deeps of the metaclass/idioclass stuff, so do I. I've done
some simple tests and found what looks like a bug for me, or at last, I did not
expected that result at all. I may be wrong, but I can't see where.
----8<----
class Object
def meta #meta is shorter than anything else
class << self; self; end
end
end
class Test1
class << self
def test
"from Test1.meta"
end
end
end
class Test2 < Test1
end
Test2 < Test1 # => true
# the bug is here
Test2.meta < Test1.meta # => nil
# it should have benn true instead of nil
# this test prove that Test2 has inherited the singleton method of Test1
Test2.test == "from Test1.meta" # => true
----8<----
A lot explore the deeps of the metaclass/idioclass stuff, so do I. I've done
some simple tests and found what looks like a bug for me, or at last, I did not
expected that result at all. I may be wrong, but I can't see where.
----8<----
class Object
def meta #meta is shorter than anything else
class << self; self; end
end
end
class Test1
class << self
def test
"from Test1.meta"
end
end
end
class Test2 < Test1
end
Test2 < Test1 # => true
# the bug is here
Test2.meta < Test1.meta # => nil
# it should have benn true instead of nil
# this test prove that Test2 has inherited the singleton method of Test1
Test2.test == "from Test1.meta" # => true
----8<----