Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

Expected: Error - variable ‘a’ is already defined in this scope

Actual: Success

int ask(let('a',3),let('a',4),get('a'))

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

czerwinskilukasz1commented, Jun 27, 2020

@czerwinskilukasz1 I’m not sure if there is issue for it, but we don’t do any differentiation between const and let currently

I added it earlier today: “Assigning to a const does not result in an error”

czerwinskilukasz1commented, Aug 10, 2020

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. @avats-dev

Let me know if you have more questions.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found