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

39 lines
1.3 KiB
Plaintext

tests/cases/conformance/es6/spread/iteratorSpreadInCall8.ts(1,5): 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/iteratorSpreadInCall8.ts (1 errors) ====
new 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'.
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;
}
}