From 6ca77065d8a3c3f674dcfc261d418834f7ffd92c Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Thu, 13 Feb 2025 21:51:22 +0100 Subject: [PATCH] Fix issue when parsing bitstructs, preventing them from implementing interfaces. --- releasenotes.md | 1 + src/compiler/parse_global.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/releasenotes.md b/releasenotes.md index 78a962790..24b289ab8 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -68,6 +68,7 @@ - Fix `poll` and `POLL_FOREVER`. - Missing end padding when including a packed struct #1966. - Issue when scalar expanding a boolean from a conditional to a bool vector #1954. +- Fix issue when parsing bitstructs, preventing them from implementing interfaces. ### Stdlib changes - Added '%h' and '%H' for printing out binary data in hexadecimal using the formatter. diff --git a/src/compiler/parse_global.c b/src/compiler/parse_global.c index 834631a1c..9036b26e4 100644 --- a/src/compiler/parse_global.c +++ b/src/compiler/parse_global.c @@ -1830,6 +1830,8 @@ static inline Decl *parse_bitstruct_declaration(ParseContext *c) if (!consume_type_name(c, "bitstruct")) return poisoned_decl; + if (!parse_interface_impls(c, &decl->interfaces)) return poisoned_decl; + TRY_CONSUME_OR_RET(TOKEN_COLON, "':' followed by bitstruct type (e.g. 'int') was expected here.", poisoned_decl); ASSIGN_TYPE_OR_RET(decl->strukt.container_type, parse_type(c), poisoned_decl);