41 lines
1,021 B
Text
41 lines
1,021 B
Text
=== tests/cases/compiler/moduleScopingBug.ts ===
|
|
module M
|
|
>M : typeof M, Symbol(M,Decl(moduleScopingBug.ts,0,0))
|
|
|
|
{
|
|
|
|
var outer: number;
|
|
>outer : number, Symbol(outer,Decl(moduleScopingBug.ts,4,7))
|
|
|
|
function f() {
|
|
>f : () => void, Symbol(f,Decl(moduleScopingBug.ts,4,22))
|
|
|
|
var inner = outer; // Ok
|
|
>inner : number, Symbol(inner,Decl(moduleScopingBug.ts,8,11))
|
|
>outer : number, Symbol(outer,Decl(moduleScopingBug.ts,4,7))
|
|
|
|
}
|
|
|
|
class C {
|
|
>C : C, Symbol(C,Decl(moduleScopingBug.ts,10,5))
|
|
|
|
constructor() {
|
|
var inner = outer; // Ok
|
|
>inner : number, Symbol(inner,Decl(moduleScopingBug.ts,15,15))
|
|
>outer : number, Symbol(outer,Decl(moduleScopingBug.ts,4,7))
|
|
}
|
|
|
|
}
|
|
|
|
module X {
|
|
>X : typeof X, Symbol(X,Decl(moduleScopingBug.ts,18,5))
|
|
|
|
var inner = outer; // Error: outer not visible
|
|
>inner : number, Symbol(inner,Decl(moduleScopingBug.ts,22,11))
|
|
>outer : number, Symbol(outer,Decl(moduleScopingBug.ts,4,7))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|