Function referencing in @return? for simplified fault declarations. Check @return? eagerly #2340.

This commit is contained in:
Christoffer Lerno
2025-11-03 23:49:35 +01:00
parent d43d7100af
commit 4a25bcc5ee
10 changed files with 200 additions and 26 deletions

View File

@@ -2463,7 +2463,16 @@ static inline bool sema_call_analyse_func_invocation(SemaContext *context, Decl
*any_val = *(any_val->inner_expr);
}
expr->call_expr.function_contracts = 0;
AstId docs = decl->func_decl.docs;
AstId docs;
if (decl->decl_kind == DECL_FNTYPE)
{
docs = decl->fntype_decl.docs;
}
else
{
docs = decl->func_decl.docs;
}
if (!safe_mode_enabled() || !sema_has_require(docs)) goto SKIP_CONTRACTS;
SemaContext temp_context;
bool success = false;