mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-05 22:48:42 +00:00
type_check_visitor fixes
This commit is contained in:
parent
ab29a785bf
commit
359a65310b
1 changed files with 8 additions and 3 deletions
|
|
@ -888,10 +888,13 @@ void TypeCheckVisitor::Visit(VariantExpression* node) {
|
|||
}
|
||||
|
||||
|
||||
current_type_ = context_manager_.AddValue(info::type::VariantType(std::nullopt, constructors, -1),
|
||||
current_type_ = context_manager_.AddValue(info::type::VariantType(std::nullopt,
|
||||
constructors,
|
||||
std::nullopt),
|
||||
utils::ValueType::Tmp);
|
||||
|
||||
current_type_ = context_manager_.AddValue(info::type::VariantType(std::nullopt, constructors, -1),
|
||||
current_type_ = context_manager_.AddValue(info::type::OptionalType(current_type_,
|
||||
context_manager_.GetValueManager()),
|
||||
utils::ValueType::Tmp);
|
||||
|
||||
node->base.type_ = current_type_;
|
||||
|
|
@ -1239,7 +1242,9 @@ void TypeCheckVisitor::Visit(VariantType* node) {
|
|||
}
|
||||
}
|
||||
|
||||
current_type_ = context_manager_.AddValue(info::type::VariantType(node->type, constructors, -1),
|
||||
current_type_ = context_manager_.AddValue(info::type::VariantType(node->type,
|
||||
constructors,
|
||||
std::nullopt),
|
||||
utils::ValueType::Tmp);
|
||||
|
||||
node->base.type_ = current_type_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue