mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
add tests for state variables accessors. normal and constant
fixed the issue with accessors for constant state variables
This commit is contained in:
+5
-2
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user