aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-11-17 07:06:57 +0800
committerchriseth <c@ethdev.com>2015-11-26 20:10:12 +0800
commit30b325fdc148d5014f04fd238362e3a1df10310f (patch)
treecd8df0c1f6e5462f2349a07d8f5f7d1fd156b4cc /test/libsolidity
parentcd94aa978a77ace1296f9978bfae6d8735b5c91d (diff)
downloaddexon-solidity-30b325fdc148d5014f04fd238362e3a1df10310f.tar.gz
dexon-solidity-30b325fdc148d5014f04fd238362e3a1df10310f.tar.zst
dexon-solidity-30b325fdc148d5014f04fd238362e3a1df10310f.zip
Allow "new expressions" also for general type names.
Breaking change: If you want to send value with a contract creation, you have to use parentheses now: `(new ContractName).value(2 ether)(arg1, arg2)`
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp2
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp18
2 files changed, 19 insertions, 1 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 93b42c51..681ab107 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -1955,7 +1955,7 @@ BOOST_AUTO_TEST_CASE(value_for_constructor)
contract Main {
Helper h;
function Main() {
- h = new Helper.value(10)("abc", true);
+ h = (new Helper).value(10)("abc", true);
}
function getFlag() returns (bool ret) { return h.getFlag(); }
function getName() returns (bytes3 ret) { return h.getName(); }
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index e87e47a8..3d9dc5b5 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -2529,6 +2529,24 @@ BOOST_AUTO_TEST_CASE(member_access_parser_ambiguity)
BOOST_CHECK(success(text));
}
+BOOST_AUTO_TEST_CASE(create_memory_arrays)
+{
+ char const* text = R"(
+ library L {
+ struct R { uint[10][10] y; }
+ struct S { uint a; uint b; uint[20][20][20] c; R d; }
+ }
+ contract C {
+ function f(uint size) {
+ L.S[][] x = new L.S[][](10);
+ var y = new uint[](20);
+ var z = new bytes(size);
+ }
+ }
+ )";
+ BOOST_CHECK(success(text));
+}
+
BOOST_AUTO_TEST_SUITE_END()
}