mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-06 06:58:45 +00:00
.
This commit is contained in:
parent
fcff4f9103
commit
d2140af3b4
2 changed files with 3 additions and 2 deletions
Binary file not shown.
|
|
@ -1159,13 +1159,14 @@ void TypeCheckVisitor::Visit(AnnotatedName* node) {
|
|||
utils::IdType type = current_type_;
|
||||
|
||||
if (!is_const_definition_.has_value()) {
|
||||
error_handling::HandleInternalError("No value in is_const_definition_", "TypeCheckVisitor.AnnotatedName");
|
||||
error_handling::HandleInternalError("No value in is_const_definition_",
|
||||
"TypeCheckVisitor.AnnotatedName");
|
||||
}
|
||||
|
||||
utils::ValueType value_type = context_manager_.GetValueType(type);
|
||||
if (value_type == utils::ValueType::Const
|
||||
&& is_const_definition_.value() == utils::IsConstModifier::Var) {
|
||||
error_handling::HandleTypecheckError("TupleName: value type expression not match variable definition modifier", node->base);
|
||||
error_handling::HandleTypecheckError("AnnotatedName: value type expression not match variable definition modifier", node->base);
|
||||
}
|
||||
|
||||
type = context_manager_.ToModifiedValue(type, utils::IsConstModifierToValueType(is_const_definition_.value()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue