TypeScript/tests/baselines/reference/iteratorSpreadInCall7.errors.txt
2015-03-25 18:03:45 -07:00

36 lines
1.3 KiB
Plaintext

tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts(1,1): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
Type argument candidate 'symbol' is not a valid type argument because it is not a supertype of candidate 'string'.
==== tests/cases/conformance/es6/spread/iteratorSpreadInCall7.ts (1 errors) ====
foo(...new SymbolIterator, ...new StringIterator);
~~~
!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
!!! error TS2453: Type argument candidate 'symbol' is not a valid type argument because it is not a supertype of candidate 'string'.
function foo<T>(...s: T[]) { return s[0]; }
class SymbolIterator {
next() {
return {
value: Symbol(),
done: false
};
}
[Symbol.iterator]() {
return this;
}
}
class StringIterator {
next() {
return {
value: "",
done: false
};
}
[Symbol.iterator]() {
return this;
}
}