2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/moduleUnassignedVariable.ts ===
|
|
|
|
module Bar {
|
2015-04-16 01:44:20 +02:00
|
|
|
>Bar : typeof Bar
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export var a = 1;
|
2015-04-16 01:44:20 +02:00
|
|
|
>a : number
|
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-16 01:44:20 +02:00
|
|
|
>fooA : () => number
|
|
|
|
>a : number
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export var b;
|
2015-04-16 01:44:20 +02:00
|
|
|
>b : any
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
function fooB() { return b; } // Incorrect: return b
|
2015-04-16 01:44:20 +02:00
|
|
|
>fooB : () => any
|
|
|
|
>b : any
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|