run following script
def foo(i)
foo(i+1)
end
def main1
begin
foo(1)
rescue
puts $!.backtrace.join("\n")
end
end
def main2
begin
foo(1)
rescue
puts $!.backtrace.join("\n")
end
end
main1
main2
this will has to “stack too deep” error at DIFFERENT line of the script
but the result will be
mm.rb:2:in foo' mm.rb:2:in
foo’
mm.rb:8:in main1' mm.rb:22 mm.rb:2:in
foo’
mm.rb:2:in foo' mm.rb:8:in
main1’
mm.rb:22
both show the 1st error position
this error should be correct