aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-04-05 02:53:23 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-04-05 17:52:22 +0800
commit96eff0ff6abc614cb44a01137dfd0df1ef750088 (patch)
treeb59ade23a7a3c87f4286400d7a8476acc7f5b892 /test/libsolidity
parentc63efebd4517d51f29082a8d0cff814a4922243d (diff)
downloaddexon-solidity-96eff0ff6abc614cb44a01137dfd0df1ef750088.tar
dexon-solidity-96eff0ff6abc614cb44a01137dfd0df1ef750088.tar.gz
dexon-solidity-96eff0ff6abc614cb44a01137dfd0df1ef750088.tar.bz2
dexon-solidity-96eff0ff6abc614cb44a01137dfd0df1ef750088.tar.lz
dexon-solidity-96eff0ff6abc614cb44a01137dfd0df1ef750088.tar.xz
dexon-solidity-96eff0ff6abc614cb44a01137dfd0df1ef750088.tar.zst
dexon-solidity-96eff0ff6abc614cb44a01137dfd0df1ef750088.zip
Error when using empty parenthesis for base class constructors that require arguments.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses.sol3
-rw-r--r--test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses_V050.sol9
-rw-r--r--test/libsolidity/syntaxTests/inheritance/base_arguments_no_parentheses.sol5
3 files changed, 16 insertions, 1 deletions
diff --git a/test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses.sol b/test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses.sol
index 9607ed60..b3fbd04a 100644
--- a/test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses.sol
+++ b/test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses.sol
@@ -3,4 +3,5 @@ contract Base {
}
contract Derived is Base(2) { }
contract Derived2 is Base(), Derived() { }
-contract Derived3 is Base, Derived {}
+// ----
+// Warning: Wrong argument count for constructor call: 0 arguments given but expected 1.
diff --git a/test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses_V050.sol b/test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses_V050.sol
new file mode 100644
index 00000000..b3728634
--- /dev/null
+++ b/test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses_V050.sol
@@ -0,0 +1,9 @@
+pragma experimental "v0.5.0";
+
+contract Base {
+ constructor(uint) public {}
+}
+contract Derived is Base(2) { }
+contract Derived2 is Base(), Derived() { }
+// ----
+// TypeError: Wrong argument count for constructor call: 0 arguments given but expected 1.
diff --git a/test/libsolidity/syntaxTests/inheritance/base_arguments_no_parentheses.sol b/test/libsolidity/syntaxTests/inheritance/base_arguments_no_parentheses.sol
new file mode 100644
index 00000000..24cca8f0
--- /dev/null
+++ b/test/libsolidity/syntaxTests/inheritance/base_arguments_no_parentheses.sol
@@ -0,0 +1,5 @@
+contract Base {
+ constructor(uint) public {}
+}
+contract Derived is Base(2) { }
+contract Derived2 is Base, Derived {}