Closed
Description
Adding optional type arguments wouldn't affect compatibility. @rbuckton Right?
TypeScript Version: 3.4.0-dev.201xxxxx
Search Terms:
Code
// A *self-contained* demonstration of the problem follows...
// Test this by running `tsc` on the command-line, rather than through another build tool such as Gulp, Webpack, etc.
Expected behavior:
interface Iterable<T, TReturn = any, TNext = undefined> {
[Symbol.iterator](): Iterator<T, TReturn, TNext>;
}
interface AsyncIterable<T, TReturn = any, TNext = undefined> {
[Symbol.asyncIterator](): AsyncIterator<T, TReturn, TNext>;
}
Actual behavior:
interface Iterable<T> {
[Symbol.iterator](): Iterator<T>;
}
interface AsyncIterable<T> {
[Symbol.asyncIterator](): AsyncIterator<T>;
}
Playground Link:
Related Issues:
Metadata
Metadata
Assignees
Labels
No labels