TypeScript/tests/baselines/reference/iteratorSpreadInCall10.errors.txt
Nathan Shively-Sanders 004b3ae018
Simplify arity errors, rewording spread errors (#43855)
* Scribbles + tests

The second test actually requires node types

* Basically working

The two simple fixes, in arity error reporting, are in, and the
simplification of arity error reporting is half-done. I haven't started
on any improvements to call assignability.

* trim out too-real test case

* Finish cleanup

And reword error a little.

* Simplify and reword spread errors

* handle spreads first

* update baselines

* Address PR comments
2021-04-29 14:38:50 -07:00

21 lines
705 B
Plaintext

tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts(15,5): error TS2556: A spread argument must either have a tuple type or be passed to a rest parameter.
==== tests/cases/conformance/es6/spread/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.