aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-09-23 23:25:59 +0800
committerchriseth <c@ethdev.com>2015-09-23 23:34:03 +0800
commitc4b7916c144355dc36591fb6aad89438942b6c9a (patch)
treefdc4dc681ca0218a364cd4d6ea6ffe756bf9e411 /test
parent09f1f1e5955fc358697b49542c6c8eb42496ef10 (diff)
downloaddexon-solidity-c4b7916c144355dc36591fb6aad89438942b6c9a.tar
dexon-solidity-c4b7916c144355dc36591fb6aad89438942b6c9a.tar.gz
dexon-solidity-c4b7916c144355dc36591fb6aad89438942b6c9a.tar.bz2
dexon-solidity-c4b7916c144355dc36591fb6aad89438942b6c9a.tar.lz
dexon-solidity-c4b7916c144355dc36591fb6aad89438942b6c9a.tar.xz
dexon-solidity-c4b7916c144355dc36591fb6aad89438942b6c9a.tar.zst
dexon-solidity-c4b7916c144355dc36591fb6aad89438942b6c9a.zip
Test that literal strings cannot be assigned to storage pointers.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 8346b8ca..cac16682 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -2308,6 +2308,16 @@ BOOST_AUTO_TEST_CASE(array_out_of_bound_access)
SOLIDITY_CHECK_ERROR_TYPE(parseAndAnalyseReturnError(text), TypeError);
}
+BOOST_AUTO_TEST_CASE(literal_string_to_storage_pointer)
+{
+ char const* text = R"(
+ contract C {
+ function f() { string x = "abc"; }
+ }
+ )";
+ SOLIDITY_CHECK_ERROR_TYPE(parseAndAnalyseReturnError(text), TypeError);
+}
+
BOOST_AUTO_TEST_SUITE_END()
}