Additional fix for #2853

This commit is contained in:
Christoffer Lerno
2026-01-27 23:43:14 +01:00
parent c1e3cfaacc
commit 4d02ce4414

View File

@@ -10938,6 +10938,12 @@ static inline bool sema_expr_analyse_lambda(SemaContext *context, Type *target_t
// so we'll declare it as weak and externally visible.
unit_register_external_symbol(context, decl);
if (context->generic_instance)
{
decl->is_templated = true;
decl->instance_id = declid(context->generic_instance);
}
// Before function analysis, lambda evaluation is deferred
if (unit->module->stage < ANALYSIS_FUNCTIONS)
{
@@ -10947,11 +10953,6 @@ static inline bool sema_expr_analyse_lambda(SemaContext *context, Type *target_t
decl->var.is_read = true;
}
decl_flatten(decl)->is_external_visible = true;
if (context->generic_instance)
{
decl->is_templated = true;
decl->instance_id = declid(context->generic_instance);
}
vec_add(unit->module->lambdas_to_evaluate, decl);
}
else