mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
docs: document the implicit call of base constructor without arguments
This commit is contained in:
parent
8d666e180d
commit
4259c0d036
@ -982,7 +982,7 @@ virtual method lookup.
|
|||||||
|
|
||||||
Constructors
|
Constructors
|
||||||
============
|
============
|
||||||
A constructor is an optional function declared with the ``constructor`` keyword which is executed upon contract creation.
|
A constructor is an optional function declared with the ``constructor`` keyword which is executed upon contract creation.
|
||||||
Constructor functions can be either ``public`` or ``internal``. If there is no constructor, the contract will assume the
|
Constructor functions can be either ``public`` or ``internal``. If there is no constructor, the contract will assume the
|
||||||
default constructor: ``contructor() public {}``.
|
default constructor: ``contructor() public {}``.
|
||||||
|
|
||||||
@ -1059,6 +1059,9 @@ derived contract. Arguments have to be given either in the
|
|||||||
inheritance list or in modifier-style in the derived constuctor.
|
inheritance list or in modifier-style in the derived constuctor.
|
||||||
Specifying arguments in both places is an error.
|
Specifying arguments in both places is an error.
|
||||||
|
|
||||||
|
If the constructor of a base contract has no arguments, it will be implicitly
|
||||||
|
executed upon contract creation.
|
||||||
|
|
||||||
.. index:: ! inheritance;multiple, ! linearization, ! C3 linearization
|
.. index:: ! inheritance;multiple, ! linearization, ! C3 linearization
|
||||||
|
|
||||||
Multiple Inheritance and Linearization
|
Multiple Inheritance and Linearization
|
||||||
@ -1139,7 +1142,7 @@ Example of a Function Type (a variable declaration, where the variable is of typ
|
|||||||
|
|
||||||
function(address) external returns (address) foo;
|
function(address) external returns (address) foo;
|
||||||
|
|
||||||
Abstract contracts decouple the definition of a contract from its implementation providing better extensibility and self-documentation and
|
Abstract contracts decouple the definition of a contract from its implementation providing better extensibility and self-documentation and
|
||||||
facilitating patterns like the `Template method <https://en.wikipedia.org/wiki/Template_method_pattern>`_ and removing code duplication.
|
facilitating patterns like the `Template method <https://en.wikipedia.org/wiki/Template_method_pattern>`_ and removing code duplication.
|
||||||
|
|
||||||
.. index:: ! contract;interface, ! interface contract
|
.. index:: ! contract;interface, ! interface contract
|
||||||
|
Loading…
Reference in New Issue
Block a user