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
Actual: Success
int ask(let('a',3),let('a',4),get('a'))
4
🦄
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
C++ multiple declarations in a local scope - Stack Overflow
To declare an object of type int , but NOT define it, the extern keyword is used. So the following should be correct...
Read more >Variable Scope | Fix error: 'yourVariable' was not declared in ...
Trying to use that variable in the setup, I get the error message… If I create my own function, and I define a...
Read more >Variables - Bohemia Interactive Community Wiki
A variable is a "storage container" or "named placeholder" for data. You can read and modify the data once this container is created....
Read more >Procedural language | BigQuery - Google Cloud
Multiple variable names can appear in a single DECLARE statement, but only one variable_type and expression . It is an error to declare...
Read more >Documentation: 15: 43.3. Declarations - PostgreSQL
If the DEFAULT clause is not given then the variable is initialized to the SQL null ... Output parameters are most useful when...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I added it earlier today: “Assigning to a const does not result in an error” https://github.com/xFAANG/askql/issues/254
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 atsrc/askvm/resources/core/let.ts
. Try to understand how it works now and why executinglet a = <value>
twice does not cause an error. @avats-devLet me know if you have more questions.