Resolving &X.b when X is a const incorrectly checked for runtime constness #2842

Creating a generic instance fails if it is created after interface checking #2840
This commit is contained in:
Christoffer Lerno
2026-01-25 21:24:27 +01:00
parent 3c04a326f4
commit 4899ee14e2
6 changed files with 52 additions and 15 deletions

View File

@@ -5374,7 +5374,29 @@ FOUND:;
break;
}
}
ASSERT(stage < ANALYSIS_INTERFACE);
if (stage < ANALYSIS_INTERFACE) goto EXIT;
if (compiler.context.errors_found) return poisoned_decl;
FOREACH(Decl *, decl, copied)
{
SemaContext context_gen;
switch (decl->decl_kind)
{
case DECL_TYPEDEF:
case DECL_STRUCT:
case DECL_UNION:
case DECL_ENUM:
case DECL_BITSTRUCT:
break;
default:
continue;
}
if (decl->interfaces)
{
sema_context_init(&context_gen, decl->unit);
sema_check_interfaces(&context_gen, decl);
sema_context_destroy(&context_gen);
}
}
EXIT:;
if (compiler.context.errors_found) return poisoned_decl;
}