mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #5541 from ethereum/clarifyCopyInheritance
[DOCS] Clarify "copying bytecode" in inheritance.
This commit is contained in:
commit
eea8cecd42
@ -1043,14 +1043,15 @@ Additional Resources for Understanding Events
|
|||||||
Inheritance
|
Inheritance
|
||||||
***********
|
***********
|
||||||
|
|
||||||
Solidity supports multiple inheritance by copying code including polymorphism.
|
Solidity supports multiple inheritance including polymorphism.
|
||||||
|
|
||||||
All function calls are virtual, which means that the most derived function
|
All function calls are virtual, which means that the most derived function
|
||||||
is called, except when the contract name is explicitly given.
|
is called, except when the contract name is explicitly given or the
|
||||||
|
``super`` keyword is used.
|
||||||
|
|
||||||
When a contract inherits from other contracts, only a single
|
When a contract inherits from other contracts, only a single
|
||||||
contract is created on the blockchain, and the code from all the base contracts
|
contract is created on the blockchain, and the code from all the base contracts
|
||||||
is copied into the created contract.
|
is compiled into the created contract.
|
||||||
|
|
||||||
The general inheritance system is very similar to
|
The general inheritance system is very similar to
|
||||||
`Python's <https://docs.python.org/3/tutorial/classes.html#inheritance>`_,
|
`Python's <https://docs.python.org/3/tutorial/classes.html#inheritance>`_,
|
||||||
|
Loading…
Reference in New Issue
Block a user