mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add override exception for interface functions.
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user