Test for assigning to non-lvalue.

This commit is contained in:
chriseth 2017-07-26 14:19:32 +02:00
parent 7ad42aeeaf
commit b8fc58850d

View File

@ -6382,6 +6382,20 @@ BOOST_AUTO_TEST_CASE(using_this_in_constructor)
CHECK_WARNING(text, "\"this\" used in constructor");
}
BOOST_AUTO_TEST_CASE(do_not_crash_on_not_lalue)
{
// This checks for a bug that caused a crash because of continued analysis.
char const* text = R"(
contract C {
mapping (uint => uint) m;
function f() {
m(1) = 2;
}
}
)";
CHECK_ERROR_ALLOW_MULTI(text, TypeError, "is not callable");
}
BOOST_AUTO_TEST_SUITE_END()
}