part of constuctor typecheck (constructors for different types)

This commit is contained in:
ProgramSnail 2024-02-22 21:57:54 +03:00
parent 005fb6aaf3
commit d7f1b6c377
3 changed files with 217 additions and 59 deletions

View file

@ -177,9 +177,10 @@ inline std::optional<size_t> get_parameters_count(Type type) {
return std::nullopt;
case Type::ARRAY:
case Type::OPTIONAL:
case Type::RESULT:
case Type::ERROR:
return 1;
case Type::RESULT: // RESULT[T E] = T | Error[E]
return 2;
// -- basic types
case Type::FLOAT:
case Type::DOUBLE: