From db9cc9c6ef2d5edb2dc3ed679c87f4d73b7b232e Mon Sep 17 00:00:00 2001 From: LianaHus Date: Thu, 24 Sep 2015 13:58:51 +0200 Subject: [PATCH] added test --- .../SolidityNameAndTypeResolution.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index cac166826..fd9089554 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -2318,6 +2318,24 @@ BOOST_AUTO_TEST_CASE(literal_string_to_storage_pointer) SOLIDITY_CHECK_ERROR_TYPE(parseAndAnalyseReturnError(text), TypeError); } +BOOST_AUTO_TEST_CASE(non_initialized_references) +{ + char const* text = R"( + contract c + { + struct s{ + uint a; + } + function f() + { + s x; + x.a = 2; + } + } + )"; + SOLIDITY_CHECK_ERROR_TYPE(parseAndAnalyseReturnError(text), TypeError); +} + BOOST_AUTO_TEST_SUITE_END() }