You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DeclarationError: Base constructor arguments given twice.
--> InheritanceConstructor.sol:37:9:
|
37 | MyLogic(_parentImplementation.MY_STORAGE())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Note: Second constructor call is here:
--> InheritanceConstructor.sol:26:20:
|
26 | constructor () MyLogic(new MyStorage()){
| ^^^^^^^^^^^^^^^^^^^^^^^^
Specification
My suggestion is to allow remove the automatic inherit of constructor when needed,then developers call super() or allow the use of override keyword in constructor - which then would remove the automatic inherited constructor.
Abstract
I want to do this:
Motivation
Sometimes changing the behavior of a constructor is needed. Specially when it is overriding another constructor.
I have a contract structure like this:
This errors:
Specification
My suggestion is to allow remove the automatic inherit of constructor when needed,then developers call super() or allow the use of
override
keyword in constructor - which then would remove the automatic inherited constructor.Using override:
Using super:
Backwards Compatibility
If not using super or override, the behavior would be as it is.
The text was updated successfully, but these errors were encountered: