diff options
Diffstat (limited to 'AST.cpp')
-rw-r--r-- | AST.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -255,6 +255,22 @@ void StructDefinition::checkRecursion() const } } +void EnumDefinition::checkValidityOfMembers() const +{ +#if 0 // LTODO: Make this work for the Declarations + vector<ASTPointer<ASTString>> members = getMembers(); + sort(begin(members), end(members)); + for (size_t i = 0; i < members.size(); ++i) + if (members[i] == members[i + 1]) + BOOST_THROW_EXCEPTION(createTypeError("Duplicate member detected in Enum")); +#endif +} + +TypePointer EnumDefinition::getType(ContractDefinition const*) const +{ + return make_shared<TypeType>(make_shared<EnumType>(*this)); +} + TypePointer FunctionDefinition::getType(ContractDefinition const*) const { return make_shared<FunctionType>(*this); |