=== tests/cases/compiler/moduleUnassignedVariable.ts === module Bar { >Bar : typeof Bar, Symbol(Bar, Decl(moduleUnassignedVariable.ts, 0, 0)) export var a = 1; >a : number, Symbol(a, Decl(moduleUnassignedVariable.ts, 1, 14)) >1 : number function fooA() { return a; } // Correct: return Bar.a >fooA : () => number, Symbol(fooA, Decl(moduleUnassignedVariable.ts, 1, 21)) >a : number, Symbol(a, Decl(moduleUnassignedVariable.ts, 1, 14)) export var b; >b : any, Symbol(b, Decl(moduleUnassignedVariable.ts, 4, 14)) function fooB() { return b; } // Incorrect: return b >fooB : () => any, Symbol(fooB, Decl(moduleUnassignedVariable.ts, 4, 17)) >b : any, Symbol(b, Decl(moduleUnassignedVariable.ts, 4, 14)) }