typeof this
stops working after for..in
or for..of
: "Cannot find name 'this'."
#46072
Labels
Bug
A bug in TypeScript
Effort: Moderate
Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".
Help Wanted
You can do this
Milestone
Bug Report
After a for..in or for..of statement, I can no longer access
typeof this
in class methods. A compile time error appears saying "Cannot find name 'this'."🔎 Search Terms
Cannot find name 'this'. typeof this class for in for of
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
The test cases
test3
andtest4
show compile errors.🙂 Expected behavior
All test cases should pass without error.
The text was updated successfully, but these errors were encountered: