Files

21 lines
623 B
Plaintext

iteratorSpreadInCall2.ts(15,5): error TS2556: A spread argument must either have a tuple type or be passed to a rest parameter.
==== iteratorSpreadInCall2.ts (1 errors) ====
function foo(s: symbol[]) { }
class SymbolIterator {
next() {
return {
value: Symbol(),
done: false
};
}
[Symbol.iterator]() {
return this;
}
}
foo(...new SymbolIterator);
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2556: A spread argument must either have a tuple type or be passed to a rest parameter.