diff --git a/lib/libimhex/source/pattern_language/validator.cpp b/lib/libimhex/source/pattern_language/validator.cpp index 72310a9d3..65880a322 100644 --- a/lib/libimhex/source/pattern_language/validator.cpp +++ b/lib/libimhex/source/pattern_language/validator.cpp @@ -11,6 +11,7 @@ namespace hex::pl { bool Validator::validate(const std::vector &ast) { std::unordered_set identifiers; + std::unordered_set types; try { @@ -24,8 +25,8 @@ namespace hex::pl { this->validate({ variableDeclNode->getType() }); } else if (auto typeDeclNode = dynamic_cast(node); typeDeclNode != nullptr) { - if (!identifiers.insert(typeDeclNode->getName().data()).second) - throwValidatorError(hex::format("redefinition of identifier '{0}'", typeDeclNode->getName().data()), typeDeclNode->getLineNumber()); + if (!types.insert(typeDeclNode->getName().data()).second) + throwValidatorError(hex::format("redefinition of type '{0}'", typeDeclNode->getName().data()), typeDeclNode->getLineNumber()); this->validate({ typeDeclNode->getType() }); } else if (auto structNode = dynamic_cast(node); structNode != nullptr) {