@@ -1851,6 +1851,12 @@ gb_internal void check_entity_decl(CheckerContext *ctx, Entity *e, DeclInfo *d,
c.scope = d->scope;
c.decl = d;
c.type_level = 0;
+ c.curr_proc_calling_convention = ProcCC_Contextless;
+
+ auto prev_flags = c.scope->flags;
+ defer (c.scope->flags = prev_flags);
+ c.scope->flags &= ~ScopeFlag_ContextDefined;
e->parent_proc_decl = c.curr_proc_decl;
e->state = EntityState_InProgress;