We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript Version: 5.3.2.
Search Terms: yield, return, iterator.
Code:
interface Result { foo: number; } function* gen(): IterableIterator<Result> { yield { foo: 1 }; return { garbage: true }; // not checked } (function go(iterator) { const { value, done } = iterator.next(); console.log(value); if (!done) { go(iterator); } })(gen());
Expected behavior: type error on return statement.
Actual behavior: no type errors.
Playground Link: https://www.typescriptlang.org/play?#code/JYOwLgpgTgZghgYwgAgEoQM4FcA2ZkDeAUMqcjAPYUBcyIWAtgEbQDcRAvkUTFiAmGAUQAKmQBzCCAAUASloBJSFDhMcEJdDhgKUADzpseAHyESZAJ7AIOACaFyVWgEZkHdmWRQIYLFBAO4nBQTHCStGBQWCjuyAD0cXQU+AgAFhAIANYQtpzc0rz8gsISFNLAytq6smaeCMIY+ATIAG5wONEANMi2wjHIALzIFVo6UAB0IBAAHmByHmT1IBgU6uM4FOLSbR0QsgukwDDI0gCEvVM1xJ6e4mUjKmP75qRcHLLSkjKy+0A
Related Issues: #26959.
The text was updated successfully, but these errors were encountered:
rbuckton
No branches or pull requests
TypeScript Version: 5.3.2.
Search Terms: yield, return, iterator.
Code:
Expected behavior: type error on return statement.
Actual behavior: no type errors.
Playground Link: https://www.typescriptlang.org/play?#code/JYOwLgpgTgZghgYwgAgEoQM4FcA2ZkDeAUMqcjAPYUBcyIWAtgEbQDcRAvkUTFiAmGAUQAKmQBzCCAAUASloBJSFDhMcEJdDhgKUADzpseAHyESZAJ7AIOACaFyVWgEZkHdmWRQIYLFBAO4nBQTHCStGBQWCjuyAD0cXQU+AgAFhAIANYQtpzc0rz8gsISFNLAytq6smaeCMIY+ATIAG5wONEANMi2wjHIALzIFVo6UAB0IBAAHmByHmT1IBgU6uM4FOLSbR0QsgukwDDI0gCEvVM1xJ6e4mUjKmP75qRcHLLSkjKy+0A
Related Issues: #26959.
The text was updated successfully, but these errors were encountered: