typeclass tree start

This commit is contained in:
ProgramSnail 2023-05-07 15:17:37 +03:00
parent c1dec6a0d1
commit 173d50672a
15 changed files with 1475 additions and 35 deletions

View file

@ -436,6 +436,36 @@ std::optional<utils::IdType> Type::GetFieldType(const std::string& name) const {
return std::nullopt;
}
std::string Type::GetTypeName() const {
size_t index = type_.index();
switch (index) {
case 0:
return "AbstractType";
case 1:
return "DefinedType";
case 2:
return "Builtin";
case 3:
return "TupleType";
case 4:
return "VariantType";
case 5:
return "ReferenceToType";
case 6:
return "FunctionType";
case 7:
return "ArrayType";
case 8:
return "OptionalType";
default:
// error
break;
}
return ""; // ??
}
//
template<typename T>