mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Modifier overriding documentation.
This commit is contained in:
parent
e1d6ce2b66
commit
086b90fc07
@ -305,8 +305,9 @@ Modifier Overriding
|
||||
===================
|
||||
|
||||
Function modifiers can override each other. This works in the same way as
|
||||
function overriding (except that there is no overloading for modifiers). The
|
||||
``override`` keyword must be used in the overriding contract:
|
||||
`function overriding <function-overriding>`_ (except that there is no overloading for modifiers). The
|
||||
``virtual`` keyword must be used on the overridden modifier
|
||||
and the ``override`` keyword must be used in the overriding modifier:
|
||||
|
||||
::
|
||||
|
||||
@ -314,7 +315,7 @@ function overriding (except that there is no overloading for modifiers). The
|
||||
|
||||
contract Base
|
||||
{
|
||||
modifier foo() {_;}
|
||||
modifier foo() virtual {_;}
|
||||
}
|
||||
|
||||
contract Inherited is Base
|
||||
@ -332,12 +333,12 @@ explicitly:
|
||||
|
||||
contract Base1
|
||||
{
|
||||
modifier foo() {_;}
|
||||
modifier foo() virtual {_;}
|
||||
}
|
||||
|
||||
contract Base2
|
||||
{
|
||||
modifier foo() {_;}
|
||||
modifier foo() virtual {_;}
|
||||
}
|
||||
|
||||
contract Inherited is Base1, Base2
|
||||
|
Loading…
Reference in New Issue
Block a user