tact-lang / tact

Tact compiler main repository
https://tact-lang.org
MIT License
371 stars 103 forks source link

Constant shadowing does not produce var-scope error #676

Closed anton-trunov closed 1 month ago

anton-trunov commented 1 month ago
const foo: Int = 42;

contract Test {
    get fun bar(): Int {
        let foo = 43;  // <--- attempt to shadow `foo` constant
        return foo;
    }
}

Moreover, the constant substitution algorithm does not respect scoping rules and the bar getter returns 42 instead of expected 43.