diff options
author | Erik Kundt <bitshift@posteo.org> | 2018-06-27 20:00:13 +0800 |
---|---|---|
committer | Erik Kundt <bitshift@posteo.org> | 2018-06-29 17:27:01 +0800 |
commit | 1346b4407f05335a039c6b71ccceebd7878fd70a (patch) | |
tree | 05fcf046c6cdea0fa06ce4aebab6de8c1249206e /test/libsolidity/syntaxTests/constructor | |
parent | 12c4eb769762d55a71ba05cf1b74b99797026f51 (diff) | |
download | dexon-solidity-1346b4407f05335a039c6b71ccceebd7878fd70a.tar dexon-solidity-1346b4407f05335a039c6b71ccceebd7878fd70a.tar.gz dexon-solidity-1346b4407f05335a039c6b71ccceebd7878fd70a.tar.bz2 dexon-solidity-1346b4407f05335a039c6b71ccceebd7878fd70a.tar.lz dexon-solidity-1346b4407f05335a039c6b71ccceebd7878fd70a.tar.xz dexon-solidity-1346b4407f05335a039c6b71ccceebd7878fd70a.tar.zst dexon-solidity-1346b4407f05335a039c6b71ccceebd7878fd70a.zip |
Updates syntax tests to new constructor syntax.
Diffstat (limited to 'test/libsolidity/syntaxTests/constructor')
3 files changed, 14 insertions, 4 deletions
diff --git a/test/libsolidity/syntaxTests/constructor/constructor_no_visibility.sol b/test/libsolidity/syntaxTests/constructor/constructor_no_visibility.sol new file mode 100644 index 00000000..df67c9fa --- /dev/null +++ b/test/libsolidity/syntaxTests/constructor/constructor_no_visibility.sol @@ -0,0 +1,2 @@ +contract A { constructor() public {} } +// ---- diff --git a/test/libsolidity/syntaxTests/constructor/constructor_no_visibility_050.sol b/test/libsolidity/syntaxTests/constructor/constructor_no_visibility_050.sol new file mode 100644 index 00000000..0f57a41f --- /dev/null +++ b/test/libsolidity/syntaxTests/constructor/constructor_no_visibility_050.sol @@ -0,0 +1,4 @@ +pragma experimental "v0.5.0"; +contract A { constructor() {} } +// ---- +// SyntaxError: (43-59): No visibility specified. diff --git a/test/libsolidity/syntaxTests/constructor/overriding_constructor.sol b/test/libsolidity/syntaxTests/constructor/overriding_constructor.sol index 3290a33b..5fb3a189 100644 --- a/test/libsolidity/syntaxTests/constructor/overriding_constructor.sol +++ b/test/libsolidity/syntaxTests/constructor/overriding_constructor.sol @@ -1,6 +1,10 @@ -// It is fine to "override" constructor of a base class since it is invisible -contract A { function A() public { } } +contract A { constructor() public {} } contract B is A { function A() public pure returns (uint8) {} } +contract C is A { function A() public pure returns (uint8) {} } +contract D is B { function B() public pure returns (uint8) {} } +contract E is D { function B() public pure returns (uint8) {} } // ---- -// Warning: (91-114): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead. -// Warning: (135-178): This declaration shadows an existing declaration. +// Warning: (57-100): This declaration shadows an existing declaration. +// Warning: (121-164): This declaration shadows an existing declaration. +// Warning: (185-228): This declaration shadows an existing declaration. +// Warning: (249-292): This declaration shadows an existing declaration. |