Fix #11660: wrong reports that block-scoped variable used before its … (#11692)

* Fix #11660: wrong reports that block-scoped variable used before its declaration

* Fix code style in checker.ts

* Add unit test for #11660

* Fix the unit test for #11660
This commit is contained in:
Dom Chen
2016-10-20 04:07:49 +08:00
committed by Mohamed Hegazy
parent 06afadda72
commit 0365c96e37
5 changed files with 139 additions and 4 deletions

View File

@@ -0,0 +1,20 @@
// @outFile: test.js
// @fileName: A.ts
namespace ts {
export function printVersion():void {
log("Version: " + sys.version); // the call of sys.version is deferred, should not report an error.
}
export function log(info:string):void {
}
}
// @fileName: B.ts
namespace ts {
export let sys:{version:string} = {version: "2.0.5"};
}