mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4074 from elopio/docs/implicit-constructor
docs: document the implicit call of base constructor without arguments
This commit is contained in:
commit
1e95335589
@ -1030,8 +1030,9 @@ A constructor set as ``internal`` causes the contract to be marked as :ref:`abst
|
||||
Arguments for Base Constructors
|
||||
===============================
|
||||
|
||||
Derived contracts need to provide all arguments needed for
|
||||
the base constructors. This can be done in two ways::
|
||||
The constructors of all the base contracts will be called following the
|
||||
linearization rules explained below. If the base constructors have arguments,
|
||||
derived contracts need to specify all of them. This can be done in two ways::
|
||||
|
||||
pragma solidity ^0.4.22;
|
||||
|
||||
@ -1059,6 +1060,9 @@ derived contract. Arguments have to be given either in the
|
||||
inheritance list or in modifier-style in the derived constuctor.
|
||||
Specifying arguments in both places is an error.
|
||||
|
||||
If a derived contract doesn't specify the arguments to all of its base
|
||||
contracts' constructors, it will be abstract.
|
||||
|
||||
.. index:: ! inheritance;multiple, ! linearization, ! C3 linearization
|
||||
|
||||
Multiple Inheritance and Linearization
|
||||
|
Loading…
Reference in New Issue
Block a user