mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
* 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:
20
tests/cases/compiler/useBeforeDeclaration.ts
Normal file
20
tests/cases/compiler/useBeforeDeclaration.ts
Normal 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"};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user