aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-09-27 21:11:44 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-10-05 18:42:34 +0800
commit09276cb9d3589493176bc45b2075517c2087d75b (patch)
tree2eff98e42245b9d33cd63a4f95567c13f862376b /test/libsolidity
parent880be2581108f570d0824352ff7221c8cae3a998 (diff)
downloaddexon-solidity-09276cb9d3589493176bc45b2075517c2087d75b.tar.gz
dexon-solidity-09276cb9d3589493176bc45b2075517c2087d75b.tar.zst
dexon-solidity-09276cb9d3589493176bc45b2075517c2087d75b.zip
Do not add members of address to contracts in experimental 0.5.0
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 350d41f1..738e0a87 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -7100,6 +7100,64 @@ BOOST_AUTO_TEST_CASE(array_length_validation)
CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal.");
}
+BOOST_AUTO_TEST_CASE(no_address_members_on_contract)
+{
+ char const* text = R"(
+ pragma experimental "v0.5.0";
+ contract C {
+ function f() {
+ this.balance;
+ }
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Member \"balance\" not found or not visible after argument-dependent lookup in contract");
+ text = R"(
+ pragma experimental "v0.5.0";
+ contract C {
+ function f() {
+ this.transfer;
+ }
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Member \"transfer\" not found or not visible after argument-dependent lookup in contract");
+ text = R"(
+ pragma experimental "v0.5.0";
+ contract C {
+ function f() {
+ this.send;
+ }
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Member \"send\" not found or not visible after argument-dependent lookup in contract");
+ text = R"(
+ pragma experimental "v0.5.0";
+ contract C {
+ function f() {
+ this.call;
+ }
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Member \"call\" not found or not visible after argument-dependent lookup in contract");
+ text = R"(
+ pragma experimental "v0.5.0";
+ contract C {
+ function f() {
+ this.callcode;
+ }
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Member \"callcode\" not found or not visible after argument-dependent lookup in contract");
+ text = R"(
+ pragma experimental "v0.5.0";
+ contract C {
+ function f() {
+ this.delegatecall;
+ }
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Member \"delegatecall\" not found or not visible after argument-dependent lookup in contract");
+}
+
BOOST_AUTO_TEST_SUITE_END()
}