mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-24 12:11:50 +00:00
Cleanup; Fix an issue with 'let' declarations reusing a local
This commit is contained in:
@ -12,3 +12,15 @@ for (let aGlobal /* that shadows */: i32 = 0; aGlobal < 1; ++aGlobal)
|
||||
let /* still not */ aConstant: f32 = 10;
|
||||
}
|
||||
}
|
||||
|
||||
// regression test: reused local should be updated with new requested type
|
||||
function fn(c: i32): void {
|
||||
{
|
||||
let a: bool = 0;
|
||||
}
|
||||
{
|
||||
let b: i32;
|
||||
b = c; // should not issue a conversion warning mentioning 'bool'
|
||||
}
|
||||
}
|
||||
fn(42);
|
||||
|
Reference in New Issue
Block a user