#pragma once #include #include #include #include // for clangd #include "utils.hpp" namespace info::type { // // Temporary frozen, TODO // struct AbstractType { // utils::IdType graph_id; // std::vector paramaters; // }; // TODO: check, if defined type is variant, etc. struct DefinedType { utils::IdType type_id; // in defined types utils::IdType type; // in types manager, created using context types }; enum class InternalType { Float, Int, String, Char, Bool, Unit, }; struct TupleType { std::optional type; std::vector, utils::IdType>> fields; }; struct VariantType { std::optional type; std::vector constructors; }; struct OptionalType { std::optional type; // Can be empty (Some or None) }; struct ReferenceToType { std::vector references; utils::IdType type; }; struct FunctionType { std::vector argument_types; utils::IdType return_type; }; struct ArrayType { size_t size; // ?? = 0 for dynamic ?? std::optional elements_type; }; using Type = std::variant; } // namespace info::type