Skip to content

Commit

Permalink
Fix crash on assignment of parapoly proc to variable
Browse files Browse the repository at this point in the history
  • Loading branch information
zen3ger committed Dec 22, 2024
1 parent 597fba7 commit 9f77f7c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/check_decl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,14 @@ gb_internal Type *check_init_variable(CheckerContext *ctx, Entity *e, Operand *o
return nullptr;
}
if (e2->state.load() != EntityState_Resolved) {
gbString str = type_to_string(t);
defer (gb_string_free(str));
error(e->token, "Invalid use of a polymorphic type '%s' in %.*s", str, LIT(context_name));
e->type = t_invalid;
e->type = t;
return nullptr;
}
gbString str = type_to_string(t);
defer (gb_string_free(str));
error(operand->expr, "Invalid use of a non-specialized polymorphic type '%s' in %.*s", str, LIT(context_name));
e->type = t_invalid;
return nullptr;
} else if (is_type_empty_union(t)) {
gbString str = type_to_string(t);
defer (gb_string_free(str));
Expand Down

0 comments on commit 9f77f7c

Please sign in to comment.