public void SplattingProtocol1() {
TestOutput(@"
class C
def respond_to? name
p name
false
end
def to_s
'c'
end
end
p [1,*C.new]
p(*C.new)
x,y = C.new
p x,y
proc {|a,b| p [a,b] }.call(C.new)
case
when *C.new;
end
def foo
yield 1,2,*C.new
end
foo do |a,b,c|
p a,b,c
end
", @"
:to_a
[1, c]
:to_a
c
:to_ary
c
nil
:to_ary
[c, nil]
:to_a
:to_a
1
2
c
");
}