Sto seguendo gli esercizi da Ruby Koans e in about_proxy_object_project.rb
c'è questo pezzo di codice:Rubino 2.0 getta "[BUG] stack errori consistenza"
class Proxy
def initialize(target_object)
@object = target_object
end
# This method was added by me
def method_missing(method_name, *args, &block)
@object.send method_name
end
end
che viene chiamato in questo modo:
def test_tv_methods_still_perform_their_function
tv = Proxy.new(Television.new) # Television is a class with a :channel attr_accessor and a power method
tv.channel = 10
tv.power
assert_equal 10, tv.channel
assert tv.on?
end
il problema è che la linea è tv.channel = 10
"rompendo" l'interprete e gettando:
[BUG] Stack consistency error (sp: 53, bp: 54)
ruby 2.0.0p0
(...)
full stack trace follows
Ho provato lo stesso codice con Ruby 1.9.3 e funziona. Sto usando Ruby 2.0.0-p195.
Quindi, questo è un errore/bug? O sto facendo qualcosa di terribilmente sbagliato?
Sembra essere stato corretto in p247, rilasciato il 27 giugno, come indicato da matt. – sawa