Disallow use of virtual and private together

This commit is contained in:
Mathias Baumann
2019-11-27 18:52:41 +01:00
parent 7ce280d7bd
commit 7bc6645218
4 changed files with 24 additions and 5 deletions
+7 -2
View File
@@ -181,8 +181,8 @@ Function Overriding
===================
Base functions can be overridden by inheriting contracts to change their
behavior. The overriding function must then use the ``override`` keyword in the
function header as shown in this example:
behavior if they are marked as ``virtual``. The overriding function must then
use the ``override`` keyword in the function header as shown in this example:
::
@@ -240,6 +240,11 @@ overridden when used with multiple inheritance:
// No explicit override required
contract D is B, C {}
.. note::
Functions with the ``private`` visibility cannot be ``virtual``.
.. _modifier-overriding:
.. index:: ! overriding;modifier