diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-14 05:52:04 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-14 06:16:14 +0800 |
commit | b2575b4bcbd15ec8353a01ae53133f6e71115cce (patch) | |
tree | ba14d6c97ca00ddc6d77876e6876c16eb7664803 /AST.cpp | |
parent | b20ce4451bb4c2b64b112b8654b36502ae654a24 (diff) | |
download | dexon-solidity-b2575b4bcbd15ec8353a01ae53133f6e71115cce.tar dexon-solidity-b2575b4bcbd15ec8353a01ae53133f6e71115cce.tar.gz dexon-solidity-b2575b4bcbd15ec8353a01ae53133f6e71115cce.tar.bz2 dexon-solidity-b2575b4bcbd15ec8353a01ae53133f6e71115cce.tar.lz dexon-solidity-b2575b4bcbd15ec8353a01ae53133f6e71115cce.tar.xz dexon-solidity-b2575b4bcbd15ec8353a01ae53133f6e71115cce.tar.zst dexon-solidity-b2575b4bcbd15ec8353a01ae53133f6e71115cce.zip |
Addressing issues with Enums in Solidity
Diffstat (limited to 'AST.cpp')
-rw-r--r-- | AST.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -209,6 +209,7 @@ vector<pair<FixedHash<4>, FunctionTypePointer>> const& ContractDefinition::getIn TypePointer EnumValue::getType(ContractDefinition const*) const { EnumDefinition const* parentDef = dynamic_cast<EnumDefinition const*>(getScope()); + solAssert(parentDef, "Enclosing Scope of EnumValue was not set"); return make_shared<EnumType>(*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 |