mirror of
https://github.com/odin-lang/Odin.git
synced 2026-05-19 14:25:10 -04:00
fix: no more deferred_return in generic parapoly type name
fix: segfault on accessing empty tags array in docs writer
This commit is contained in:
@@ -2476,7 +2476,9 @@ gb_internal Type *check_get_results(CheckerContext *ctx, Scope *scope, Ast *_res
|
||||
param_value = handle_parameter_value(ctx, nullptr, &type, default_value, false);
|
||||
} else {
|
||||
if (ctx->allow_polymorphic_types && ast_references_poly_params(ctx->scope, field->type)) {
|
||||
type = alloc_type_generic(ctx->scope, 0, string_interner_insert(str_lit("$deferred_return")), nullptr);
|
||||
gbString name = expr_to_string(field->type);
|
||||
type = alloc_type_generic(ctx->scope, 0, string_interner_insert(make_string_c(name)), nullptr);
|
||||
gb_string_free(name);
|
||||
} else {
|
||||
type = check_type(ctx, field->type);
|
||||
}
|
||||
|
||||
@@ -670,8 +670,10 @@ gb_internal OdinDocTypeIndex odin_doc_type(OdinDocWriter *w, Type *type, bool ca
|
||||
auto tags = array_make<OdinDocString>(heap_allocator(), type->Struct.fields.count);
|
||||
defer (array_free(&tags));
|
||||
|
||||
for_array(i, type->Struct.fields) {
|
||||
tags[i] = odin_doc_write_string(w, type->Struct.tags[i]);
|
||||
if (type->Struct.tags != nullptr) {
|
||||
for_array(i, type->Struct.fields) {
|
||||
tags[i] = odin_doc_write_string(w, type->Struct.tags[i]);
|
||||
}
|
||||
}
|
||||
|
||||
doc_type.tags = odin_write_slice(w, tags.data, tags.count);
|
||||
|
||||
Reference in New Issue
Block a user