Library cannot have constructors

This commit is contained in:
Alex Beregszaszi
2017-08-21 11:03:55 +01:00
parent 83b90f3e8a
commit fe25bcf350
3 changed files with 14 additions and 0 deletions
@@ -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"(