diff options
author | chriseth <chris@ethereum.org> | 2018-03-17 02:02:15 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-04-03 20:53:48 +0800 |
commit | a54fdc495f54bd16c329ca3f79d533d540cb9a3e (patch) | |
tree | 97539bd0526e6da954444ac4d9867c1197a219ec /test/libsolidity | |
parent | d21382157cbda53d98f3a4e0d7c0d0a7d213aebf (diff) | |
download | dexon-solidity-a54fdc495f54bd16c329ca3f79d533d540cb9a3e.tar.gz dexon-solidity-a54fdc495f54bd16c329ca3f79d533d540cb9a3e.tar.zst dexon-solidity-a54fdc495f54bd16c329ca3f79d533d540cb9a3e.zip |
Fix: Treat empty base constructor argument list as not provided.
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses.sol | 6 | ||||
-rw-r--r-- | test/libsolidity/syntaxTests/inheritance/too_few_base_arguments.sol | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses.sol b/test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses.sol new file mode 100644 index 00000000..76df0657 --- /dev/null +++ b/test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses.sol @@ -0,0 +1,6 @@ +contract Base { + function Base(uint) public {} +} +contract Derived is Base(2) { } +contract Derived2 is Base(), Derived() { } +contract Derived3 is Base, Derived {} diff --git a/test/libsolidity/syntaxTests/inheritance/too_few_base_arguments.sol b/test/libsolidity/syntaxTests/inheritance/too_few_base_arguments.sol new file mode 100644 index 00000000..82aba308 --- /dev/null +++ b/test/libsolidity/syntaxTests/inheritance/too_few_base_arguments.sol @@ -0,0 +1,10 @@ +contract Base { + function Base(uint, uint) public {} +} +contract Derived is Base(2) { } +contract Derived2 is Base { + function Derived2() Base(2) public { } +} +// ---- +// TypeError: Wrong argument count for constructor call: 1 arguments given but expected 2. +// TypeError: Wrong argument count for modifier invocation: 1 arguments given but expected 2. |