mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Fix error message handling
This commit is contained in:
+1
-1
@@ -1619,7 +1619,7 @@ gb_internal bool check_proc_body(CheckerContext *ctx_, Token token, DeclInfo *de
|
|||||||
if (e->kind != Entity_Variable) {
|
if (e->kind != Entity_Variable) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (is_type_polymorphic(e->type)) {
|
if (is_type_polymorphic(e->type) && is_type_polymorphic_record_unspecialized(e->type)) {
|
||||||
gbString s = type_to_string(e->type);
|
gbString s = type_to_string(e->type);
|
||||||
char const *msg = "Unspecialized polymorphic types are not allowed in procedure parameters, got %s";
|
char const *msg = "Unspecialized polymorphic types are not allowed in procedure parameters, got %s";
|
||||||
if (e->Variable.type_expr) {
|
if (e->Variable.type_expr) {
|
||||||
|
|||||||
+2
-2
@@ -2100,8 +2100,8 @@ gb_internal bool is_type_polymorphic_record_unspecialized(Type *t) {
|
|||||||
t = base_type(t);
|
t = base_type(t);
|
||||||
if (t->kind == Type_Struct) {
|
if (t->kind == Type_Struct) {
|
||||||
return t->Struct.is_polymorphic && !t->Struct.is_poly_specialized;
|
return t->Struct.is_polymorphic && !t->Struct.is_poly_specialized;
|
||||||
} else if (t->kind == Type_Struct) {
|
} else if (t->kind == Type_Union) {
|
||||||
return t->Struct.is_polymorphic && !t->Struct.is_poly_specialized;
|
return t->Union.is_polymorphic && !t->Union.is_poly_specialized;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user