Files

21 lines
635 B
Plaintext

iteratorSpreadInCall10.ts(15,5): error TS2556: A spread argument must either have a tuple type or be passed to a rest parameter.
==== iteratorSpreadInCall10.ts (1 errors) ====
function foo<T>(s: T[]) { return s[0] }
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.