public void BlockReturnOptimization7() {
StackUnwinder.InstanceCount = 0;
TestOutput(@"
def f1
f2 { return 123 }
puts 'unreachable'
end
def f2
1.times { yield }
end
p f1
", @"
123
");
Assert(StackUnwinder.InstanceCount == 0);
TestOutput(@"
def f1
f2 { return 123 }
puts 'unreachable'
end
def f2
1.times { eval('yield') }
end
p f1
", @"
123
");
Assert(StackUnwinder.InstanceCount == 1);
}