fixes, build_visitor TupleType and VariantType fix

This commit is contained in:
ProgramSnail 2023-05-17 17:57:56 +03:00
parent 692f7ea3ec
commit b723fd6a65
12 changed files with 321 additions and 241 deletions

View file

@ -48,7 +48,7 @@ struct AnyType {
interpreter::tokens::AnyType* value;
utils::ClassModifier modifier;
utils::IdType parent_namespace;
utils::IdType parent_namespace = 0;
};
struct Type {
@ -57,8 +57,8 @@ struct Type {
struct Constructor {
std::string name;
size_t order;
utils::IdType type_id;
std::optional<size_t> order; // no order for tuple types
utils::IdType type_id = 0;
std::optional<interpreter::tokens::TupleType*> constructor_tuple_node;
};
@ -83,9 +83,9 @@ struct Typeclass {
std::vector<Parameter> parameters;
interpreter::tokens::TypeclassDefinitionStatement* node;
utils::IdType parent_namespace;
utils::IdType parent_namespace = 0;
utils::IdType graph_id_; // TODO: make safe??
utils::IdType graph_id_ = 0; // TODO: make safe??
};
struct Import {
@ -101,7 +101,7 @@ struct Namespace {
std::unordered_map<std::string, utils::IdType> var_namespaces;
std::unordered_map<std::string, utils::IdType> const_namespaces;
utils::IdType parent_namespace;
utils::IdType parent_namespace = 0;
utils::ClassInternalsModifier modifier = utils::ClassInternalsModifier::Static;
std::string type_name;