Multiple variable declarations in the same scope do not result in an error.See original GitHub issue
🦄 .editor // Entering editor mode (^D to finish, ^C to cancel) let a = 3 let a = 4 a
Expected: Error - variable ‘a’ is already defined in this scope
int ask(let('a',3),let('a',4),get('a')) 4 🦄
- Created 3 years ago
Top GitHub Comments
Hello Aditya, welcome to AskQL project!
This issue is related to AskVM (Ask Virtual Machine), which is interpreting code in AskCode and keeping track of resources (functions) and variables defined.
First, it would be good if you get familiar with the part of code you are going to work on. In this case it is how defining variables work in AskVM. The code for AskVM lives in
src/askvm, while for the code which handles defining variables start looking at
src/askvm/resources/core/let.ts. Try to understand how it works now and why executing
let a = <value> twice does not cause an error.
Let me know if you have more questions.