K
Kero van Gelder
Hi!
Up to 1.8.0-preview6, the code below prints three lines (A, B, A).
1.8.0-preview7 prints only two (A, B).
What's going on?
Bye,
Kero.
class A
def initialize(&block)
p "A #{block}" if block_given?
end
end
class B < A
def initialize(&block)
super() { puts "world" }
p "B #{block}" if block_given?
end
end
B.new() { puts "hello" } # results in two lines printed, OK
B.new() # nothing printed
Up to 1.8.0-preview6, the code below prints three lines (A, B, A).
1.8.0-preview7 prints only two (A, B).
What's going on?
Bye,
Kero.
class A
def initialize(&block)
p "A #{block}" if block_given?
end
end
class B < A
def initialize(&block)
super() { puts "world" }
p "B #{block}" if block_given?
end
end
B.new() { puts "hello" } # results in two lines printed, OK
B.new() # nothing printed