TypeScript/tests/baselines/reference/moduleUnassignedVariable.types

21 lines
742 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/moduleUnassignedVariable.ts ===
module Bar {
2015-04-13 23:01:57 +02:00
>Bar : typeof Bar, Symbol(Bar, Decl(moduleUnassignedVariable.ts, 0, 0))
2014-08-15 23:33:16 +02:00
export var a = 1;
2015-04-13 23:01:57 +02:00
>a : number, Symbol(a, Decl(moduleUnassignedVariable.ts, 1, 14))
2015-04-13 21:36:11 +02:00
>1 : number
2014-08-15 23:33:16 +02:00
function fooA() { return a; } // Correct: return Bar.a
2015-04-13 23:01:57 +02:00
>fooA : () => number, Symbol(fooA, Decl(moduleUnassignedVariable.ts, 1, 21))
>a : number, Symbol(a, Decl(moduleUnassignedVariable.ts, 1, 14))
2014-08-15 23:33:16 +02:00
export var b;
2015-04-13 23:01:57 +02:00
>b : any, Symbol(b, Decl(moduleUnassignedVariable.ts, 4, 14))
2014-08-15 23:33:16 +02:00
function fooB() { return b; } // Incorrect: return b
2015-04-13 23:01:57 +02:00
>fooB : () => any, Symbol(fooB, Decl(moduleUnassignedVariable.ts, 4, 17))
>b : any, Symbol(b, Decl(moduleUnassignedVariable.ts, 4, 14))
2014-08-15 23:33:16 +02:00
}