aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-07-26 20:19:32 +0800
committerchriseth <chris@ethereum.org>2017-07-26 20:32:25 +0800
commitb8fc58850d9f37c22dedca3ed189f2fdd5458236 (patch)
tree2ba6d269589010ecdf5d792e7b737ec671a84c22 /test/libsolidity
parent7ad42aeeafe9f6d47ef5890add06b51d005b32ca (diff)
downloaddexon-solidity-b8fc58850d9f37c22dedca3ed189f2fdd5458236.tar.gz
dexon-solidity-b8fc58850d9f37c22dedca3ed189f2fdd5458236.tar.zst
dexon-solidity-b8fc58850d9f37c22dedca3ed189f2fdd5458236.zip
Test for assigning to non-lvalue.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 4b29243a..de698c77 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -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()
}