Ensure that UDQDefine::eval returns nodes with correct name

This commit is contained in:
Joakim Hove
2020-10-20 20:45:59 +02:00
parent 5ff65747f3
commit 313f576e37

View File

@@ -253,6 +253,8 @@ bool dynamic_type_check(UDQVarType lhs, UDQVarType rhs) {
UDQSet UDQDefine::eval(UDQContext& context) const {
UDQSet res = this->ast->eval(this->m_var_type, context);
res.name( this->m_keyword );
if (!dynamic_type_check(this->var_type(), res.var_type())) {
std::string msg = "Invalid runtime type conversion detected when evaluating UDQ";
throw std::invalid_argument(msg);
@@ -298,7 +300,6 @@ UDQSet UDQDefine::eval(UDQContext& context) const {
}
}
res.name( this->m_keyword );
return res;
}