type_check_visitor first iteration, value, execution_visitor started

This commit is contained in:
ProgramSnail 2023-05-07 19:52:35 +03:00
parent 173d50672a
commit 890bd90eba
22 changed files with 481 additions and 452 deletions

View file

@ -50,9 +50,14 @@ void LinkSymbolsVisitor::Visit(TypeExpression* node) { // TODO: check
node->type_id_ = namespace_visitor_.FindType(path, node->type.type);
node->constructor_id_ = namespace_visitor_.FindConstructor(path, node->type.type);
// if (!node->type_id_.has_value() && !node->constructor_id_.has_value()) { // TODO: check, that not bastract types
// error_handling::HandleTypecheckError("Type or constructor not found", node->base);
// }
if (path.size() == 0 && namespace_visitor_.FindAbstractType(node->type.type).has_value()) { // TODO
// abstract / basic / TODO: local abstract type
return;
}
if (!node->type_id_.has_value() && !node->constructor_id_.has_value()) { // TODO: check, that not bastract types
error_handling::HandleTypecheckError("Type or constructor not found", node->base);
}
if (node->constructor_id_.has_value()) {
utils::IdType constructor_type_id = namespace_visitor_.GetGlobalInfo()->GetConstructorInfo(node->constructor_id_.value()).type_id;