Implicit Symbol.iterator call does not check additional arguments #57130
Labels
Bug
A bug in TypeScript
Fix Available
A PR has been opened for this issue
Rescheduled
This issue was previously scheduled to an earlier milestone
Milestone
π Search Terms
Symbol.iterator, for-of, iterable protocol
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play?#code/MYewdgzgLgBAtgTwJJQKYCcCGAjANqmAXhgG8AoGSmAKgG0BlBObEXAOgEs0soR0BdABSoAHlCwBBdAHMAXDDABXZhgCUpClS0IOqXABNSMTPNHjMU6TAC+myrdtkA9E+NgYGdHxgALTAAd-VEhfDFQ2GABxEBB9NjIAM29BUEhYERgQBPhkbhx8BiYWdi4MTF4BQVVVci0RNkwyRxcFEA90L3RQ9HCYACFMQ1kAWkFE5NToGAysnJQyvFQau2mGprIgA
π» Code
π Actual behavior
When using a for-of loop, there is no type error.
π Expected behavior
I expect an error to be reported, as if explicitly calling the
[Symbol.iterator]
method.Additional information about the issue
Related to #38388, which points out that resolution does not infer
this
generic type parameter.The text was updated successfully, but these errors were encountered: