From c22770ccd0ce25bea3ca5b7debdd69b10222da37 Mon Sep 17 00:00:00 2001 From: cs01 Date: Mon, 20 Apr 2026 09:59:49 -0700 Subject: [PATCH] =?UTF-8?q?refactor(codegen):=20migrate=20member.ts=20to?= =?UTF-8?q?=20typeof()=20=E2=80=94=20annotator=20cache=20first,=20falls=20?= =?UTF-8?q?through=20to=20rich=20resolver=20(phase-e=20step=205)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/codegen/expressions/access/member.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/codegen/expressions/access/member.ts b/src/codegen/expressions/access/member.ts index 7ac1dc2b..ecc4fefa 100644 --- a/src/codegen/expressions/access/member.ts +++ b/src/codegen/expressions/access/member.ts @@ -204,7 +204,7 @@ export interface MemberAccessGeneratorContext { classGenIsStaticField(className: string, fieldName: string): boolean; classGenGetStaticFieldType(className: string, fieldName: string): string; mangleUserName(name: string): string; - resolveExpressionTypeRich(expr: Expression): ResolvedType | null; + typeOf(expr: Expression): ResolvedType | null; } export type MemberAccessHandlerFn = ( @@ -2230,7 +2230,7 @@ export class MemberAccessGenerator { // interface/class element — i.e. the object is a depth-1 array. For // depth>1 (e.g. `P[][]` indexed once → `P[]`) the result is still an // array and the indexed-object-array element-info is not appropriate. - const rich = this.ctx.resolveExpressionTypeRich(arrayExpr); + const rich = this.ctx.typeOf(arrayExpr); if (rich && rich.arrayDepth === 1 && rich.fields) { return { keys: rich.fields.keys, types: rich.fields.types, tsTypes: rich.fields.tsTypes }; } @@ -2887,7 +2887,7 @@ export class MemberAccessGenerator { // returns of a declared interface, this routes through the // named-interface path (correct struct layout, metadata propagated // for nested access). Unblocks `s.build().inner.v` chains. - const rich = this.ctx.resolveExpressionTypeRich(expr.object); + const rich = this.ctx.typeOf(expr.object); if (rich && rich.arrayDepth === 0 && rich.base) { const rt = rich.base; if (this.ctx.interfaceStructGen?.hasInterface(rt)) {