abstract types typecheck, fixes

This commit is contained in:
ProgramSnail 2023-05-16 12:43:55 +03:00
parent 9aeba7b0de
commit c433448952
9 changed files with 143 additions and 94 deletions

View file

@ -26,6 +26,8 @@ struct TypeUsage {
struct Parameter {
std::string type;
std::vector<interpreter::tokens::ParametrizedTypeclass*> typeclass_nodes;
interpreter::tokens::AnyAnnotatedType* node = nullptr;
};
struct AbstractType {
@ -82,15 +84,16 @@ struct Typeclass {
interpreter::tokens::TypeclassDefinitionStatement* node;
utils::IdType parent_namespace;
utils::IdType graph_id_; // TODO: make safe??
};
struct Import {
std::string module_name;
std::vector<std::string> symbols; // size = 0 => all symbols imported
std::vector<std::string> symbols; // size == 0 => all symbols imported
};
struct Namespace {
std::unordered_map<std::string, utils::IdType> types;
std::unordered_map<std::string, utils::IdType> functions;
std::unordered_map<std::string, utils::IdType> constructors;
@ -103,7 +106,8 @@ struct Namespace {
utils::ClassInternalsModifier modifier = utils::ClassInternalsModifier::Static;
std::string type_name;
std::optional<interpreter::tokens::Namespace*> node;
// all nodes have same info
std::optional<interpreter::tokens::Namespace*> any_node;
};
} // namespace info::definition