diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-17 05:19:08 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-21 18:03:55 +0800 |
commit | fe25bcf350bfb65ddb69bc5e7d3f65dfa6d23fa7 (patch) | |
tree | 687f73c7e2b1a6b752960dd6e3580788b673279f /test | |
parent | 83b90f3e8a3ee168ba00eff33c4443d00bbb8a57 (diff) | |
download | dexon-solidity-fe25bcf350bfb65ddb69bc5e7d3f65dfa6d23fa7.tar dexon-solidity-fe25bcf350bfb65ddb69bc5e7d3f65dfa6d23fa7.tar.gz dexon-solidity-fe25bcf350bfb65ddb69bc5e7d3f65dfa6d23fa7.tar.bz2 dexon-solidity-fe25bcf350bfb65ddb69bc5e7d3f65dfa6d23fa7.tar.lz dexon-solidity-fe25bcf350bfb65ddb69bc5e7d3f65dfa6d23fa7.tar.xz dexon-solidity-fe25bcf350bfb65ddb69bc5e7d3f65dfa6d23fa7.tar.zst dexon-solidity-fe25bcf350bfb65ddb69bc5e7d3f65dfa6d23fa7.zip |
Library cannot have constructors
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index fb2686fc..fad1ca61 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -3055,6 +3055,16 @@ BOOST_AUTO_TEST_CASE(library_having_variables) CHECK_ERROR(text, TypeError, "Library cannot have non-constant state variables"); } +BOOST_AUTO_TEST_CASE(library_constructor) +{ + char const* text = R"( + library Lib { + function Lib(); + } + )"; + CHECK_ERROR_ALLOW_MULTI(text, TypeError, "Constructor cannot be defined in libraries."); +} + BOOST_AUTO_TEST_CASE(valid_library) { char const* text = R"( |