Add inline to enums #1819.

This commit is contained in:
Christoffer Lerno
2025-02-03 22:51:44 +01:00
parent 70a849cbb5
commit 9d2f4e72c2
8 changed files with 156 additions and 39 deletions

View File

@@ -1463,6 +1463,7 @@ static inline bool sema_analyse_enum(SemaContext *context, Decl *decl, bool *era
// Resolve the type of the enum.
if (!sema_resolve_type_info(context, decl->enums.type_info, RESOLVE_TYPE_DEFAULT)) return false;
if (decl->enums.inline_index > -1 || decl->enums.inline_value) decl->is_substruct = true;
Type *type = decl->enums.type_info->type;
ASSERT(!type_is_optional(type) && "Already stopped when parsing.");