summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-28 01:06:38 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-28 01:06:38 +0100
commitaf95065aa32179ff26894e57dfca9e52c0d61e89 (patch)
tree9b681b4ed3272e3d1edb1802a5e8fdc8e054b50b
parentca414c19fd8f2658403b189bfccad11ad2db048b (diff)
Checking parentStructure for being acyclic
-rw-r--r--src/core/model/Typesystem.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/model/Typesystem.cpp b/src/core/model/Typesystem.cpp
index 158cf07..c10fc02 100644
--- a/src/core/model/Typesystem.cpp
+++ b/src/core/model/Typesystem.cpp
@@ -383,6 +383,11 @@ bool StructType::doBuild(Variant &data, Logger &logger) const
bool StructType::doValidate(Logger &logger) const
{
return validateName(logger) &
+ validateIsAcyclic("parent", [](const Node *thisRef) -> const Node * {
+ return dynamic_cast<const StructType *>(
+ thisRef)->parentStructure.get();
+ },
+ logger) &
continueValidationCheckDuplicates(attributes, logger);
}