Resolved build errors

1. Fixed constructor calls in AstTransformer.cs by adding missing nestedTypes parameter
  2. Fixed constructor calls in AstJsonSerializer.cs by adding logic to deserialize nestedTypes
  3. Fixed constructor calls in AstBuilder.cs by adding empty nestedTypes lists and correct parameters
  4. Fixed test files by updating ClassDeclaration constructors with proper parameters
This commit is contained in:
2025-07-23 05:24:18 -04:00
parent 2cc1e3d283
commit 5439aeb081
5 changed files with 45 additions and 18 deletions

View File

@@ -201,7 +201,7 @@ namespace MarketAlly.IronJava.Core.AST.Builders
return new ClassDeclaration(
location, name, modifiers, annotations, typeParameters,
superClass, interfaces, members, javaDoc
superClass, interfaces, members, new List<TypeDeclaration>(), javaDoc, false
);
}
@@ -218,7 +218,7 @@ namespace MarketAlly.IronJava.Core.AST.Builders
return new InterfaceDeclaration(
location, name, modifiers, annotations, typeParameters,
extendedInterfaces, members, javaDoc
extendedInterfaces, members, new List<TypeDeclaration>(), javaDoc
);
}
@@ -236,7 +236,7 @@ namespace MarketAlly.IronJava.Core.AST.Builders
return new EnumDeclaration(
location, name, modifiers, annotations,
interfaces, constants, members, javaDoc
interfaces, constants, members, new List<TypeDeclaration>(), javaDoc
);
}
@@ -250,7 +250,7 @@ namespace MarketAlly.IronJava.Core.AST.Builders
var javaDoc = ExtractJavaDoc(context);
return new AnnotationDeclaration(
location, name, modifiers, annotations, members, javaDoc
location, name, modifiers, annotations, members, new List<TypeDeclaration>(), javaDoc
);
}
@@ -1125,7 +1125,9 @@ namespace MarketAlly.IronJava.Core.AST.Builders
null,
new List<TypeReference>(),
members,
null
new List<TypeDeclaration>(),
null,
false
);
}
@@ -2108,7 +2110,9 @@ namespace MarketAlly.IronJava.Core.AST.Builders
type,
new List<TypeReference>(),
members,
null
new List<TypeDeclaration>(),
null,
false
);
}
@@ -2829,7 +2833,9 @@ namespace MarketAlly.IronJava.Core.AST.Builders
type,
new List<TypeReference>(),
members,
null
new List<TypeDeclaration>(),
null,
false
);
}

View File

@@ -149,6 +149,7 @@ namespace MarketAlly.IronJava.Core.AST.Transformation
node.SuperClass,
node.Interfaces,
transformedMembers,
node.NestedTypes,
node.JavaDoc,
node.IsRecord
);
@@ -201,6 +202,7 @@ namespace MarketAlly.IronJava.Core.AST.Transformation
node.SuperClass,
node.Interfaces,
transformedMembers,
node.NestedTypes,
node.JavaDoc,
node.IsRecord
);
@@ -336,6 +338,7 @@ namespace MarketAlly.IronJava.Core.AST.Transformation
node.SuperClass,
node.Interfaces,
transformedMembers,
node.NestedTypes,
node.JavaDoc,
node.IsRecord
);

View File

@@ -829,9 +829,10 @@ namespace MarketAlly.IronJava.Core.Serialization
var interfaces = DeserializeList<ClassOrInterfaceType>(element.GetProperty("interfaces"));
var members = DeserializeList<MemberDeclaration>(element.GetProperty("members"));
var nestedTypes = DeserializeList<TypeDeclaration>(element.GetProperty("nestedTypes"));
var isRecord = element.GetProperty("isRecord").GetBoolean();
return new ClassDeclaration(location, name, modifiers, annotations, typeParameters, superClass, interfaces, members, javaDoc, isRecord);
return new ClassDeclaration(location, name, modifiers, annotations, typeParameters, superClass, interfaces, members, nestedTypes, javaDoc, isRecord);
}
private InterfaceDeclaration DeserializeInterfaceDeclaration(JsonElement element, SourceRange location)
@@ -846,8 +847,9 @@ namespace MarketAlly.IronJava.Core.Serialization
var extendedInterfaces = DeserializeList<ClassOrInterfaceType>(element.GetProperty("extendedInterfaces"));
var members = DeserializeList<MemberDeclaration>(element.GetProperty("members"));
var nestedTypes = DeserializeList<TypeDeclaration>(element.GetProperty("nestedTypes"));
return new InterfaceDeclaration(location, name, modifiers, annotations, typeParameters, extendedInterfaces, members, javaDoc);
return new InterfaceDeclaration(location, name, modifiers, annotations, typeParameters, extendedInterfaces, members, nestedTypes, javaDoc);
}
private EnumDeclaration DeserializeEnumDeclaration(JsonElement element, SourceRange location)
@@ -862,8 +864,9 @@ namespace MarketAlly.IronJava.Core.Serialization
var interfaces = DeserializeList<ClassOrInterfaceType>(element.GetProperty("interfaces"));
var constants = DeserializeList<EnumConstant>(element.GetProperty("constants"));
var members = DeserializeList<MemberDeclaration>(element.GetProperty("members"));
var nestedTypes = DeserializeList<TypeDeclaration>(element.GetProperty("nestedTypes"));
return new EnumDeclaration(location, name, modifiers, annotations, interfaces, constants, members, javaDoc);
return new EnumDeclaration(location, name, modifiers, annotations, interfaces, constants, members, nestedTypes, javaDoc);
}
private AnnotationDeclaration DeserializeAnnotationDeclaration(JsonElement element, SourceRange location)
@@ -876,8 +879,9 @@ namespace MarketAlly.IronJava.Core.Serialization
: null;
var members = DeserializeList<AnnotationMember>(element.GetProperty("members"));
var nestedTypes = DeserializeList<TypeDeclaration>(element.GetProperty("nestedTypes"));
return new AnnotationDeclaration(location, name, modifiers, annotations, members, javaDoc);
return new AnnotationDeclaration(location, name, modifiers, annotations, members, nestedTypes, javaDoc);
}
private FieldDeclaration DeserializeFieldDeclaration(JsonElement element, SourceRange location)

View File

@@ -246,7 +246,9 @@ namespace MarketAlly.IronJava.Tests
null
)
},
null
new List<TypeDeclaration>(),
null,
false
);
var builder = new TransformationBuilder()
@@ -348,7 +350,9 @@ namespace MarketAlly.IronJava.Tests
null,
new List<TypeReference>(),
new List<MemberDeclaration> { mainMethod, helperMethod, field },
null
new List<TypeDeclaration>(),
null,
false
);
return new CompilationUnit(
@@ -393,7 +397,9 @@ namespace MarketAlly.IronJava.Tests
null,
new List<TypeReference> { serializableInterface },
new List<MemberDeclaration> { serializeMethod },
null
new List<TypeDeclaration>(),
null,
false
);
return new CompilationUnit(

View File

@@ -55,7 +55,9 @@ namespace MarketAlly.IronJava.Tests
null,
new List<TypeReference>(),
new List<MemberDeclaration> { mainMethod },
null
new List<TypeDeclaration>(),
null,
false
);
var compilationUnit = new CompilationUnit(
@@ -137,7 +139,9 @@ namespace MarketAlly.IronJava.Tests
null,
new List<TypeReference>(),
new List<MemberDeclaration>(),
null
new List<TypeDeclaration>(),
null,
false
);
var outerClass = new ClassDeclaration(
@@ -149,7 +153,9 @@ namespace MarketAlly.IronJava.Tests
null,
new List<TypeReference>(),
new List<MemberDeclaration>(),
null
new List<TypeDeclaration>(),
null,
false
);
// Navigate the AST
@@ -194,7 +200,9 @@ namespace MarketAlly.IronJava.Tests
null,
new List<TypeReference>(),
new List<MemberDeclaration> { field },
null
new List<TypeDeclaration>(),
null,
false
);
var compilationUnit = new CompilationUnit(