Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 4 additions & 7 deletions src/codegen/expressions/access/chained-access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ export function handleNestedInterfaceField(
const keys: string[] = [];
const tsTypes: string[] = [];
const types: string[] = [];
if (nestedInterfaceDef.fields) {
for (let i = 0; i < nestedInterfaceDef.fields.length; i++) {
const f = nestedInterfaceDef.fields[i] as { name: string; type: string };
keys.push(stripOptional(f.name));
tsTypes.push(f.type);
types.push(tsTypeToLlvm(f.type));
}
for (const f of ctx.getAllInterfaceFields(nestedInterfaceDef)) {
keys.push(stripOptional(f.name));
tsTypes.push(f.type);
types.push(tsTypeToLlvm(f.type));
}
ctx.setJsonObjectMetadata(fieldItem, { keys, types, tsTypes, interfaceType: undefined });
}
Expand Down
14 changes: 4 additions & 10 deletions src/codegen/llvm-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -696,13 +696,10 @@ export class LLVMGenerator extends BaseGenerator implements IGeneratorContext {
const keys: string[] = [];
const types: string[] = [];
const tsTypes: string[] = [];
for (let i = 0; i < this.ast.interfaces.length; i++) {
const iface = this.ast.interfaces[i];
for (const iface of this.ast.interfaces) {
if (!iface) continue;
if (iface.name === cleanName) {
if (!iface.fields) continue;
for (let j = 0; j < iface.fields.length; j++) {
const field = iface.fields[j] as InterfaceField;
for (const field of this.getAllInterfaceFields(iface)) {
if (!field) continue;
let fieldName = field.name;
if (fieldName.endsWith("?")) {
Expand Down Expand Up @@ -805,13 +802,10 @@ export class LLVMGenerator extends BaseGenerator implements IGeneratorContext {
return null;
}
if (!this.ast || !this.ast.interfaces) return null;
for (let i = 0; i < this.ast.interfaces.length; i++) {
const iface = this.ast.interfaces[i];
for (const iface of this.ast.interfaces) {
if (!iface) continue;
if (iface.name === interfaceName) {
if (!iface.fields) continue;
for (let j = 0; j < iface.fields.length; j++) {
const f = iface.fields[j] as InterfaceField;
for (const f of this.getAllInterfaceFields(iface)) {
if (!f) continue;
let fName = f.name;
if (fName.endsWith("?")) {
Expand Down
Loading