### π Search Terms TS7022 circularity ### π Version & Regression Information - This changed between versions 5.3.3 and 5.4.2 ### β― Playground Link * [5.4.2](https://www.typescriptlang.org/play?#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXywGcAeAFQD4AKANwC55SBKe6gwhgbgCgw9CN4OegCVwOGMGL8YWVAHMANPGmy55eAB94aUIlkhg8ALzwA3gF9uWRPEo5GZrvCTjbvVP3gBrEAE8C+PaOzs7untRQEMgIJjgA2j6+ALrcIQQ2lERSGDLyVBFRIIwOpk4h5mUV5kA) * [5.3.3](https://www.typescriptlang.org/play?ts=5.3.3#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXywGcAeAFQD4AKANwC55SBKe6gwhgbgCgw9CN4OegCVwOGMGL8YWVAHMANPGmy55eAB94aUIlkhg8ALzwA3gF9uWRPEo5GZrvCTjbvVP3gBrEAE8C+PaOzs7untRQEMgIJjgA2j6+ALrcIQQ2lERSGDLyVBFRIIwOpk4h5mUV5kA) ### π» Code ```ts declare function is<T>(v: T): v is T; const o: Record<string, string> | undefined = {}; if (o) { for (const key in o) { const value = o[key]; if (is<string>(value)) { } } } ``` ### π Actual behavior TS7022: `value` implicitly has type `any` because it does not have a type annotation and is referenced directly or indirectly in its own initializer. ### π Expected behavior No error, like in 5.3.3. ### Additional information about the issue _No response_
Activity
RyanCavanaugh commentedon Mar 11, 2024
Bisects to #57358