Modifier overriding documentation.

This commit is contained in:
chriseth 2019-12-09 16:08:02 +01:00
parent e1d6ce2b66
commit 086b90fc07

View File

@ -305,8 +305,9 @@ Modifier Overriding
=================== ===================
Function modifiers can override each other. This works in the same way as Function modifiers can override each other. This works in the same way as
function overriding (except that there is no overloading for modifiers). The `function overriding <function-overriding>`_ (except that there is no overloading for modifiers). The
``override`` keyword must be used in the overriding contract: ``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 contract Base
{ {
modifier foo() {_;} modifier foo() virtual {_;}
} }
contract Inherited is Base contract Inherited is Base
@ -332,12 +333,12 @@ explicitly:
contract Base1 contract Base1
{ {
modifier foo() {_;} modifier foo() virtual {_;}
} }
contract Base2 contract Base2
{ {
modifier foo() {_;} modifier foo() virtual {_;}
} }
contract Inherited is Base1, Base2 contract Inherited is Base1, Base2