Comments (4)
Hmm, that's weird 🤔 This should throw a declaration error the first time you re-declare a variable.
I don't seem to be able to reproduce this. Could it be that the error is delayed from the first instance of the re-declaration? (maybe delayed by ganache; error location matches mine in the screenshot). Can you check the output of .dump
after you re-declare b
(this is what's being evaluated)?
Also, note that delete <var>
will reset its value to default (zero for unit) and not undeclare it. You'll still get a declaration error if you attempt to declare the variable again.
from solidity-shell.
Sure, here you go. It appears you're right. It's just not triggering an error the first time.
🚀 Entering interactive Solidity shell. '.help' and '.exit' are your friends.
» ℹ️ ganache-mgr: starting temp. ganache instance ...
»
» uint a = 1101*10**18
» uint b = 310*10**18
» a/b
3
» uint a = 11*10**22
» uint b = 310*10**22
[
{
component: 'general',
errorCode: '2333',
formattedMessage: 'DeclarationError: Identifier already declared.\n' +
'Note: The previous declaration is here:\n' +
'\n',
message: 'Identifier already declared.',
secondarySourceLocations: [ [Object] ],
severity: 'error',
sourceLocation: { end: 219, file: '', start: 213 },
type: 'DeclarationError'
}
]
» .dump
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.7;
contract MainContract {
function main() public {
uint a = 1101*10**18;
uint b = 310*10**18;
a/b;
return ;
}
}
from solidity-shell.
Hey 🙌 ,
just published a new version that may fix an issue where an error wasn't returned even though it should. Can you give it a try?
Else, would be great if you could just run ganache-cli
in another shell window, keep the console open. then start solidity-shell
which should connect to your running ganache instance. Now try to reproduce the issue and check if there is a delay between solidity-shell and the ganache rpc calls. It does not reproduce on my local machine (macos) but if we can track it down I might be able to check what's going wrong :)
cheers
from solidity-shell.
I'm closing this for now. feel free to reopen if you have more information on how to reproduce. thanks!
from solidity-shell.
Related Issues (16)
- Installer fails without ganache-cli HOT 1
- uint128(~0) ? HOT 1
- Potential windows difference HOT 5
- address[] usage in global context? HOT 3
- Division by non factors fail HOT 2
- does this support for loops HOT 1
- Externally-fetched interfaces from Etherscan may not match internal solc version HOT 1
- Improvement: etherscan API key
- Might we use "⟠" as prompt?
- some compiling Error occured
- some compiling Error occured
- Global variable block missing from the shell HOT 1
- first steps HOT 5
- Import Statements not working HOT 2
- Localhost doesn't work on MacOS Big Sur 11.6.1 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solidity-shell.