diff --git a/src/Type.cc b/src/Type.cc index fdcbddf9c7..f5a93c3315 100644 --- a/src/Type.cc +++ b/src/Type.cc @@ -484,6 +484,19 @@ SetType::SetType(TypeList* ind, ListExpr* arg_elements) : TableType(ind, 0) } } +SetType* SetType::ShallowClone() + { + // constructor only consumes indices when elements + // is set + if ( elements && indices ) + { + elements->Ref(); + indices->Ref(); + } + + return new SetType(indices, elements); + } + SetType::~SetType() { Unref(elements); diff --git a/src/Type.h b/src/Type.h index a97f7360c8..043ec5c928 100644 --- a/src/Type.h +++ b/src/Type.h @@ -381,6 +381,8 @@ public: SetType(TypeList* ind, ListExpr* arg_elements); ~SetType() override; + SetType* ShallowClone() override; + ListExpr* SetElements() const { return elements; } protected: