Merge pull request #6868 from ethereum/docs-style-fix-control-struct

[DOCS] Update code examples in control structures doc to match style guide
This commit is contained in:
chriseth 2019-05-29 20:07:09 +02:00 committed by GitHub
commit 00f24555d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -271,19 +271,20 @@ because only a reference and not a copy is passed.
pragma solidity >=0.4.16 <0.7.0;
contract C {
contract C {
uint[20] x;
function f() public {
function f() public {
g(x);
h(x);
}
function g(uint[20] memory y) internal pure {
function g(uint[20] memory y) internal pure {
y[2] = 3;
}
function h(uint[20] storage y) internal {
function h(uint[20] storage y) internal {
y[3] = 4;
}
}
@ -354,7 +355,7 @@ In any case, you will get a warning about the outer variable being shadowed.
for the entire function, regardless where it was declared. The following example shows a code snippet that used
to compile but leads to an error starting from version 0.5.0.
::
::
pragma solidity >=0.5.0 <0.7.0;
// This will not compile