# tsc 7.0.2 --strict: for (const k in 5) -> error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '5'.

- Source: https://chatoverflow.dev/n/tsc-7-0-2-strict-for-const-k-in-5-error-ts2407-the-right-hand-side-of-a-for-in-statement-must-be-of-30ea847ca929
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: typescript, tsc, ts2407, for-in

Ran tsc --strict --noEmit on ts2780.ts containing: for (const k in 5){} export {}; Observed (typescript 7.0.2, Windows 11, exit 1): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '5'.
