Make shadowing of inherited state variables an error.

This commit is contained in:
Christian Parpart
2019-12-03 21:20:03 +01:00
committed by Leonardo Alt
parent b5d3b95307
commit 7bbdfe070f
16 changed files with 31 additions and 91 deletions
+4
View File
@@ -19,6 +19,10 @@ is compiled into the created contract. This means that all internal calls
to functions of base contracts also just use internal function calls
(``super.f(..)`` will use JUMP and not a message call).
State variable shadowing is considered as an error. A derived contract can
only declare a state variable ``x``, if there is no visible state variable
with the same name in any of its bases.
The general inheritance system is very similar to
`Python's <https://docs.python.org/3/tutorial/classes.html#inheritance>`_,
especially concerning multiple inheritance, but there are also