Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/codegen/expressions/access/member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down Expand Up @@ -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 };
}
Expand Down Expand Up @@ -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)) {
Expand Down
Loading