mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow use of virtual and private together
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user