mirror of
https://codeberg.org/ProgramSnail/lang.git
synced 2025-12-17 04:18:43 +00:00
part of constuctor typecheck (constructors for different types)
This commit is contained in:
parent
005fb6aaf3
commit
d7f1b6c377
3 changed files with 217 additions and 59 deletions
|
|
@ -243,6 +243,21 @@ public:
|
|||
std::move(parameters)));
|
||||
}
|
||||
|
||||
TypeProxy add_error_of(TypeProxy type, Node node = Node()) {
|
||||
if (type.type_storage_ != this) {
|
||||
error_handling::handle_general_error(
|
||||
"TypeStorage: Can't add error of type from another type "
|
||||
"storage");
|
||||
}
|
||||
|
||||
std::vector<nodes::TypeProxy> parameters;
|
||||
parameters.push_back(type);
|
||||
|
||||
return add_type(Type(Identifier(node, Identifier::SIMPLE_TYPE,
|
||||
builtin::types::ERROR_IDENTIFIER),
|
||||
std::move(parameters)));
|
||||
}
|
||||
|
||||
nodes::TypeProxy add_container_of(std::vector<TypeProxy> &¶meters,
|
||||
builtin::types::Type container,
|
||||
Node node = Node()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue