From 3330aa8a3c6d33f2f58f3144f53fa1dd3bb02a72 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Wed, 13 May 2026 22:02:43 +0800 Subject: [PATCH] test typedesc field access --- compiler/semexprs.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index aa0489cd22..b9420893d5 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1500,7 +1500,8 @@ proc tryReadingTypeField(c: PContext, n: PNode, i: PIdent, ty: PType): PNode = markUsed(c, n.info, f) onUse(n.info, f) of tyObject, tyTuple: - if ty.n != nil and ty.n.kind == nkRecList: + if c.inTypeofContext > 0 and + ty.n != nil and ty.n.kind == nkRecList: let field = lookupInRecord(ty.n, i) if field != nil: n.typ = makeTypeDesc(c, field.typ)