Unreachable Code
See original GitHub issue function payInterest(uint256 amount) public payable {
uint256 interest = calculateInterestAmount(amount);
require(
msg.value == interest,
"Not the entire interest amount deposited"
);
interestPaid[msg.sender][amount] = true;
}
The tool throws an unreachable code
error at the require
statement and the statement following it.
calculateInterestAmount
returns just the number 10.
Also, the code is working fine in the truffle test suits.
Issue Analytics
- State:
- Created 2 years ago
- Comments:29 (13 by maintainers)
Top Results From Across the Web
Warning: unreachable code after return statement - JavaScript
When an expression exists after a valid return statement, a warning is given to indicate that the code after the return statement is...
Read more >Unreachable Code Error in Java - GeeksforGeeks
The Unreachable statements refers to statements that won't get executed during the execution of the program are called Unreachable ...
Read more >Unreachable Code - Tutorialspoint
Unreachable code, a part of the source code that will never be executed due to inappropriate exit points/control flow. The other kind of...
Read more >Why is this code giving an "unreachable code" error?
All i'm doing is declaring an integer and it's telling me that the code is unreachable. private class myStack{ Object [] myStack =...
Read more >Unreachable code - Go Systems Programming [Book] - O'Reilly
Unreachable code Unreachable code is code that can never be executed and is a logical kind of error. As the Go compiler itself...
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
Confirmed, after restarting VS Code I got
0.8.6
. Cache issues remain one of the major challenges in modern software engineering 😜Great. I created an issue on our side to fix it in a more permanent manner (https://github.com/ethereum/solidity/issues/11572). The problem is that outright disabling caching for this file might not be a good idea (it got 5 TB of traffic last month) so we might have to modify our mirroring to just invalidate stuff after every update.