aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-10-06 02:29:43 +0800
committerGitHub <noreply@github.com>2017-10-06 02:29:43 +0800
commitb8e904616a22507371fd994a3193412711ab6ddd (patch)
treee6f7b4daf9db485a2932524f9084b615595de82d /test
parentd0fa56a217f50458b128b0a570724cdac0a5ee1a (diff)
parent81519845bc35043c8460252e62a30a137f93432d (diff)
downloaddexon-solidity-b8e904616a22507371fd994a3193412711ab6ddd.tar.gz
dexon-solidity-b8e904616a22507371fd994a3193412711ab6ddd.tar.zst
dexon-solidity-b8e904616a22507371fd994a3193412711ab6ddd.zip
Merge pull request #3014 from ethereum/require-storage-keyword
Require location keyword for local variables (0.5.0)
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 738e0a87..a6fc4e34 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -6523,7 +6523,19 @@ BOOST_AUTO_TEST_CASE(warn_unspecified_storage)
}
}
)";
- CHECK_WARNING(text, "is declared as a storage pointer. Use an explicit \"storage\" keyword to silence this warning");
+ CHECK_WARNING(text, "Variable is declared as a storage pointer. Use an explicit \"storage\" keyword to silence this warning");
+ text = R"(
+ pragma experimental "v0.5.0";
+ contract C {
+ struct S { uint a; }
+ S x;
+ function f() view public {
+ S y = x;
+ y;
+ }
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Storage location must be specified as either \"memory\" or \"storage\".");
}
BOOST_AUTO_TEST_CASE(implicit_conversion_disallowed)