mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #3433 from ZoOgY-DoOgY/patch-1
Inheritance, "super" and DDD
This commit is contained in:
commit
513c771e2c
@ -942,12 +942,12 @@ derived override, but this function will bypass
|
|||||||
contract Final is Base1, Base2 {
|
contract Final is Base1, Base2 {
|
||||||
}
|
}
|
||||||
|
|
||||||
If ``Base1`` calls a function of ``super``, it does not simply
|
If ``Base2`` calls a function of ``super``, it does not simply
|
||||||
call this function on one of its base contracts. Rather, it
|
call this function on one of its base contracts. Rather, it
|
||||||
calls this function on the next base contract in the final
|
calls this function on the next base contract in the final
|
||||||
inheritance graph, so it will call ``Base2.kill()`` (note that
|
inheritance graph, so it will call ``Base1.kill()`` (note that
|
||||||
the final inheritance sequence is -- starting with the most
|
the final inheritance sequence is -- starting with the most
|
||||||
derived contract: Final, Base1, Base2, mortal, owned).
|
derived contract: Final, Base2, Base1, mortal, owned).
|
||||||
The actual function that is called when using super is
|
The actual function that is called when using super is
|
||||||
not known in the context of the class where it is used,
|
not known in the context of the class where it is used,
|
||||||
although its type is known. This is similar for ordinary
|
although its type is known. This is similar for ordinary
|
||||||
|
Loading…
Reference in New Issue
Block a user