From ffeafeab743a3083f814a61c1a1e4f6320ce0ef6 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Thu, 11 Jun 2026 16:12:28 +0200 Subject: [PATCH] fix state array constant types (#25893) else there's a mismatch in the AST for the bracket constructor (cherry picked from commit 13d152a4d18d0e28264d1ddbf2e17b6237d9e059) --- compiler/closureiters.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/closureiters.nim b/compiler/closureiters.nim index 7d6553386f..e88b261f88 100644 --- a/compiler/closureiters.nim +++ b/compiler/closureiters.nim @@ -252,7 +252,8 @@ proc newCurExcAccess(ctx: var Ctx): PNode = ctx.newEnvVarAccess(ctx.curExcSym) proc newStateLabel(ctx: Ctx): PNode = - ctx.g.newIntLit(TLineInfo(), 0) + result = nkIntLit.newIntNode(0) + result.typ = getSysType(ctx.g, TLineInfo(), tyInt16) proc newState(ctx: var Ctx, n: PNode, inlinable: bool, label: PNode): PNode = # Creates a new state, adds it to the context