mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Test for assigning to non-lvalue.
This commit is contained in:
parent
7ad42aeeaf
commit
b8fc58850d
@ -6382,6 +6382,20 @@ BOOST_AUTO_TEST_CASE(using_this_in_constructor)
|
|||||||
CHECK_WARNING(text, "\"this\" used 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()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user