From b2575b4bcbd15ec8353a01ae53133f6e71115cce Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 13 Feb 2015 22:52:04 +0100 Subject: Addressing issues with Enums in Solidity --- AST.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'AST.cpp') diff --git a/AST.cpp b/AST.cpp index 9d7d2169..5aa67218 100644 --- a/AST.cpp +++ b/AST.cpp @@ -209,6 +209,7 @@ vector, FunctionTypePointer>> const& ContractDefinition::getIn TypePointer EnumValue::getType(ContractDefinition const*) const { EnumDefinition const* parentDef = dynamic_cast(getScope()); + solAssert(parentDef, "Enclosing Scope of EnumValue was not set"); return make_shared(*parentDef); } @@ -271,7 +272,7 @@ void EnumDefinition::checkValidityOfMembers() const sort(begin(members), end(members), compareDecls); for (size_t i = 0; i < members.size() - 1; ++i) if (members[i]->getName() == members[i + 1]->getName()) - BOOST_THROW_EXCEPTION(createTypeError("Duplicate member detected in Enum")); + BOOST_THROW_EXCEPTION(members[i]->createTypeError("Duplicate member detected in Enum")); } TypePointer EnumDefinition::getType(ContractDefinition const*) const -- cgit