TypeScript/tests/cases/compiler/useBeforeDeclaration.ts
Dom Chen 0365c96e37 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
2016-10-19 13:07:49 -07:00

21 lines
365 B
TypeScript

// @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"};
}