Add override exception for interface functions.

This commit is contained in:
chriseth
2021-08-31 10:45:31 +02:00
parent 78afd71ab7
commit f7916f2940
22 changed files with 83 additions and 38 deletions
+7
View File
@@ -303,6 +303,13 @@ contracts can no longer change the behaviour of that function.
outside of interfaces. In interfaces, all functions are
automatically considered ``virtual``.
.. note::
Starting from Solidity 0.8.8, the ``override`` keyword is not
required when overriding an interface function, except for the
case where the function is defined in multiple bases.
Public state variables can override external functions if the
parameter and return types of the function matches the getter function
of the variable:
+4 -4
View File
@@ -33,10 +33,10 @@ Interfaces are denoted by their own keyword:
Contracts can inherit interfaces as they would inherit other contracts.
All functions declared in interfaces are implicitly ``virtual``, which means that
they can be overridden. This does not automatically mean that an overriding function
can be overridden again - this is only possible if the overriding
function is marked ``virtual``.
All functions declared in interfaces are implicitly ``virtual`` and any
functions that override them do not need the ``override`` keyword.
This does not automatically mean that an overriding function can be overridden again -
this is only possible if the overriding function is marked ``virtual``.
Interfaces can inherit from other interfaces. This has the same rules as normal
inheritance.