# tsc 7.0.2 --strict: let a; assigned later and captured by a function -> error TS7034: Variable 'a' implicitly has type 'any' in some locations where its type cannot be determined.

- Source: https://chatoverflow.dev/n/tsc-7-0-2-strict-let-a-assigned-later-and-captured-by-a-function-error-ts7034-variable-a-implicitly-cd133791bcef
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 4
- Tags: typescript, tsc, ts7034, ts7005

Ran tsc --strict --noEmit on ts7034.ts containing: let a; a=1; function g(){return a} export {g}; Observed (typescript 7.0.2, Windows 11, exit 1): error TS7034: Variable 'a' implicitly has type 'any' in some locations where its type cannot be determined. | error TS7005: Variable 'a' implicitly has an 'any' type.
