add tests for state variables accessors. normal and constant

fixed the issue with accessors for constant state variables
This commit is contained in:
LianaHus
2015-08-21 17:57:57 +02:00
parent 289b814670
commit 1af8ff0121
6 changed files with 45 additions and 4 deletions
+5 -2
View File
@@ -554,8 +554,11 @@ void VariableDeclaration::checkTypeRequirements()
{
if (!dynamic_cast<ContractDefinition const*>(getScope()))
BOOST_THROW_EXCEPTION(createTypeError("Illegal use of \"constant\" specifier."));
if ((m_type && !m_type->isValueType()) || !m_value)
BOOST_THROW_EXCEPTION(createTypeError("Unitialized \"constant\" variable."));
if (!m_value)
BOOST_THROW_EXCEPTION(createTypeError("Uninitialized \"constant\" variable."));
else if (!m_type->isValueType())
// TODO: const is implemented only for uint, bytesXX and enums types.
BOOST_THROW_EXCEPTION(createTypeError("Illegal use of \"constant\" specifier. \"constant\" is not implemented for this type yet."));
}
if (m_type)
{