Files

21 lines
638 B
Plaintext

iteratorSpreadInCall4.ts(15,5): error TS2556: A spread argument must either have a tuple type or be passed to a rest parameter.
==== iteratorSpreadInCall4.ts (1 errors) ====
function foo(s1: symbol, ...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.