42 lines
534 B
Text
42 lines
534 B
Text
|
=== tests/cases/compiler/moduleScopingBug.ts ===
|
||
|
module M
|
||
|
>M : typeof M
|
||
|
|
||
|
{
|
||
|
|
||
|
var outer: number;
|
||
|
>outer : number
|
||
|
|
||
|
function f() {
|
||
|
>f : () => void
|
||
|
|
||
|
var inner = outer; // Ok
|
||
|
>inner : number
|
||
|
>outer : number
|
||
|
|
||
|
}
|
||
|
|
||
|
class C {
|
||
|
>C : C
|
||
|
|
||
|
constructor() {
|
||
|
var inner = outer; // Ok
|
||
|
>inner : number
|
||
|
>outer : number
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
module X {
|
||
|
>X : typeof X
|
||
|
|
||
|
var inner = outer; // Error: outer not visible
|
||
|
>inner : number
|
||
|
>outer : number
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|