mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-24 20:21:48 +00:00
Control flow evaluator; Support for block-level let/const variables
This commit is contained in:
14
tests/compiler/scoped.ts
Normal file
14
tests/compiler/scoped.ts
Normal file
@ -0,0 +1,14 @@
|
||||
var aGlobal: i32 = 1;
|
||||
const aConstant: i32 = 3;
|
||||
|
||||
let aStartFunctionLocal: i32 = 2;
|
||||
for (var anotherStartFunctionLocal: i32 = 0; anotherStartFunctionLocal < 1; ++anotherStartFunctionLocal);
|
||||
for (let aGlobal /* that shadows */: i32 = 0; aGlobal < 1; ++aGlobal)
|
||||
aGlobal;
|
||||
|
||||
{
|
||||
let /* actually not */ aConstant: i64 = 5;
|
||||
{
|
||||
let /* still not */ aConstant: f32 = 10;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user