xo-expression: bugfix: ensure in-layer uniqueness of vars

This commit is contained in:
Roland Conybeare 2024-07-03 14:43:34 -04:00
commit f18c33b249
2 changed files with 9 additions and 2 deletions

View file

@ -25,6 +25,11 @@ namespace xo {
return new Variable(name, var_type);
}
/** return copy of x: same var, different object identity **/
static ref::rp<Variable> copy(ref::brw<Variable> x) {
return new Variable(x->name(), x->valuetype());
}
/** downcast from Expression **/
static ref::brw<Variable> from(ref::brw<Expression> x) {
return ref::brw<Variable>::from(x);