aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityNameAndTypeResolution.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/libsolidity/SolidityNameAndTypeResolution.cpp')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 44ac1511..b4ab5f8d 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -1036,6 +1036,19 @@ BOOST_AUTO_TEST_CASE(private_state_variable)
BOOST_CHECK_MESSAGE(function == nullptr, "Accessor function of an internal variable should not exist");
}
+BOOST_AUTO_TEST_CASE(missing_state_variable)
+{
+ char const* text = R"(
+ contract Scope {
+ function getStateVar() constant returns (uint stateVar) {
+ stateVar = Scope.stateVar; // should fail.
+ }
+ }
+ )";
+ BOOST_CHECK(expectError(text) == Error::Type::TypeError);
+}
+
+
BOOST_AUTO_TEST_CASE(base_class_state_variable_accessor)
{
// test for issue #1126 https://github.com/ethereum/cpp-ethereum/issues/1126