public void RubyProcArgConversion4() {
AssertOutput(delegate() {
CompilerTest(@"
class C
def respond_to? name
puts name
$has_to_proc
end
def to_proc
lambda { puts 'ok' }
end
end
c = C.new
$has_to_proc = false
1.times(&c) rescue puts 'error'
$has_to_proc = true
1.times(&c)
");
}, @"
to_proc
error
to_proc
ok
");
}