- @deprecated in function contracts would be processed twice, causing a compilation error despite being correct.

This commit is contained in:
Christoffer Lerno
2026-02-27 01:23:04 +01:00
parent f4751737e4
commit 443ee75ccd
2 changed files with 3 additions and 1 deletions

View File

@@ -10,7 +10,7 @@
- Add contract on `any_to_enum_ordinal` and `any_to_int` to improve error when passed an empty any. #2977
### Fixes
None
- `@deprecated` in function contracts would be processed twice, causing a compilation error despite being correct.
## 0.7.10 Change list

View File

@@ -1958,6 +1958,7 @@ static bool parse_element_contract(ParseContext *c, ContractDescription *contrac
INLINE void attach_deprecation_from_contract(ParseContext *c, ContractDescription *contract, Decl *decl)
{
if (contract->deprecated) vec_add(decl->attributes, contract->deprecated);
contract->deprecated = NULL;
}
/**
@@ -3649,6 +3650,7 @@ Decl *parse_top_level_statement(ParseContext *c, ParseContext **context_out)
break;
case TOKEN_FN:
decl = parse_func_definition(c, &contracts, c->unit->is_interface_file ? FUNC_PARSE_C3I : FUNC_PARSE_REGULAR);
break;
case TOKEN_CT_ASSERT:
{