mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
37 lines
940 B
Plaintext
37 lines
940 B
Plaintext
iteratorSpreadInCall8.ts(31,32): error TS2345: Argument of type 'string' is not assignable to parameter of type 'symbol'.
|
|
|
|
|
|
==== iteratorSpreadInCall8.ts (1 errors) ====
|
|
class Foo<T> {
|
|
constructor(...s: T[]) { }
|
|
}
|
|
|
|
class SymbolIterator {
|
|
next() {
|
|
return {
|
|
value: Symbol(),
|
|
done: false
|
|
};
|
|
}
|
|
|
|
[Symbol.iterator]() {
|
|
return this;
|
|
}
|
|
}
|
|
|
|
class _StringIterator {
|
|
next() {
|
|
return {
|
|
value: "",
|
|
done: false
|
|
};
|
|
}
|
|
|
|
[Symbol.iterator]() {
|
|
return this;
|
|
}
|
|
}
|
|
|
|
new Foo(...new SymbolIterator, ...new _StringIterator);
|
|
~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'symbol'. |