// @target: esnext // GH: https://github.com/microsoft/TypeScript/issues/33239 class ConstantIterator implements AsyncIterator { constructor(private constant: T) { } async next(value?: T): Promise> { if (value != null) { throw new Error("ConstantIterator.prototype.next may not take any values"); } return { value: this.constant, done: false }; } }