diff options
author | chriseth <chris@ethereum.org> | 2017-08-21 22:37:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-21 22:37:09 +0800 |
commit | 48651fc057d75b604eb65b8979b109d3887b6cbd (patch) | |
tree | 577b2d76fbc0388954f69b750a50796f2ba17b63 /test | |
parent | 1be713acc7abc2f1d21d962e840b1e369d1d8ff6 (diff) | |
parent | 01b4bba0ed7544ed6f54f97dd5d5a3b0d397fbfa (diff) | |
download | dexon-solidity-48651fc057d75b604eb65b8979b109d3887b6cbd.tar dexon-solidity-48651fc057d75b604eb65b8979b109d3887b6cbd.tar.gz dexon-solidity-48651fc057d75b604eb65b8979b109d3887b6cbd.tar.bz2 dexon-solidity-48651fc057d75b604eb65b8979b109d3887b6cbd.tar.lz dexon-solidity-48651fc057d75b604eb65b8979b109d3887b6cbd.tar.xz dexon-solidity-48651fc057d75b604eb65b8979b109d3887b6cbd.tar.zst dexon-solidity-48651fc057d75b604eb65b8979b109d3887b6cbd.zip |
Merge pull request #2763 from ethereum/library-constructor
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"( |