mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix code snippets in docs not passing tests on versions matching their pragmas
This commit is contained in:
parent
304b2fe232
commit
0f6f4314b6
@ -30,7 +30,7 @@ Not all types for constants and immutables are implemented at this time. The onl
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.7.2;
|
||||
pragma solidity >=0.7.4;
|
||||
|
||||
uint constant X = 32**22 + 8;
|
||||
|
||||
|
@ -83,7 +83,7 @@ registering with a username and password, all you need is an Ethereum keypair.
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.5.99 <0.8.0;
|
||||
pragma solidity >=0.7.0 <0.8.0;
|
||||
|
||||
contract Coin {
|
||||
// The keyword "public" makes variables
|
||||
|
@ -49,7 +49,7 @@ The following example shows a contract and a function using all available tags.
|
||||
.. code:: Solidity
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.10 <0.8.0;
|
||||
pragma solidity >=0.6.12 <0.8.0;
|
||||
|
||||
/// @title A simulator for trees
|
||||
/// @author Larry A. Gardner
|
||||
|
@ -1071,6 +1071,10 @@ No::
|
||||
|
||||
and in ``Congress.sol``::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity ^0.7.0;
|
||||
|
||||
|
||||
import "./owned.sol";
|
||||
|
||||
|
||||
|
@ -243,7 +243,7 @@ individual elements:
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.4.0 <0.8.0;
|
||||
pragma solidity >=0.4.16 <0.8.0;
|
||||
|
||||
contract C {
|
||||
function f() public pure {
|
||||
@ -554,4 +554,4 @@ assigning it to a local variable, as in
|
||||
.. note::
|
||||
Until Solidity 0.7.0, memory-structs containing members of storage-only types (e.g. mappings)
|
||||
were allowed and assignments like ``campaigns[campaignID] = Campaign(beneficiary, goal, 0, 0)``
|
||||
in the example above would work and just silently skip those members.
|
||||
in the example above would work and just silently skip those members.
|
||||
|
Loading…
Reference in New Issue
Block a user