Created
August 29, 2020 18:57
-
-
Save alerdenisov/015c70d480a5c90c97176da2e6d85824 to your computer and use it in GitHub Desktop.
Shadowing issue with named returns
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity 0.4.11; | |
contract A { | |
uint foo = 50; | |
/** | |
* @dev Public getter of private `foo` field | |
* @return Returns value of `foo` | |
*/ | |
function GetFoo() constant returns (uint foo) { | |
return foo; // returns 0 not 50, because of shadowing | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment