The following code: ```ts function foo() { function bar() { console.log(x) } let x: undefined; } ``` Is transpiled to invalid lua syntax: ```lua function foo(self) local x local function bar(self) print(x) end x = end ``` [Playground link](https://typescripttolua.github.io/play/#code/GYVwdgxgLglg9mABMOcAUBKRBvAUIg5caeJAIwEMAnTHfQhiBAZzgBsBTAOjbgHM0ADwz0CAX1GJOURIIBcicABMOwGGA5KA3LjFA)