From 260125a5d31f0048cbceb800ef5ad29f83c266db Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Tue, 5 May 2015 12:33:41 +0200 Subject: [PATCH] added test --- .../SolidityNameAndTypeResolution.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index c317dad97..9616777ab 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -1761,6 +1761,25 @@ BOOST_AUTO_TEST_CASE(uninitialized_var) BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError); } +BOOST_AUTO_TEST_CASE(deny_overwriting_of_attributes_when_deriving) +{ + // bug #1798 + char const* sourceCode = R"( + contract owned { + address owner; + } + + contract reg { + function owner(bytes32 x) returns (address) {} + } + + contract x is owned, reg { + } + )"; + ETH_TEST_CHECK_NO_THROW(parseTextAndResolveNames(sourceCode), "Parsing and Name Resolving Failed"); + //BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError); +} + BOOST_AUTO_TEST_SUITE_END() }