Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Poco array fields are null #311

Closed
kuh0005 opened this issue May 10, 2024 · 3 comments · Fixed by #312
Closed

[BUG] Poco array fields are null #311

kuh0005 opened this issue May 10, 2024 · 3 comments · Fixed by #312
Labels
bug Something isn't working question Further information is requested

Comments

@kuh0005
Copy link
Collaborator

kuh0005 commented May 10, 2024

ixc compiler do not generate iniializer for poco array fields

@kuh0005 kuh0005 added bug Something isn't working question Further information is requested labels May 10, 2024
@kuh0005
Copy link
Collaborator Author

kuh0005 commented May 10, 2024

/cib

1 similar comment
@PTKu
Copy link
Member

PTKu commented May 10, 2024

/cib

@IX-BOT
Copy link
Contributor

IX-BOT commented May 10, 2024

Branch 311-_BUG_Poco_array_fields_are_null created!

IX-BOT added a commit that referenced this issue May 10, 2024
@PTKu PTKu closed this as completed in #312 May 10, 2024
PTKu added a commit that referenced this issue May 10, 2024
* Create draft PR for #311

* The most significant changes involve the addition of the `CsPlainConstructorBuilder.cs` file and modifications to the `CsPlainSourceBuilder.cs` file. The new file contains the `CsPlainConstructorBuilder` class, which is used to build constructors for classes. The `CsPlainSourceBuilder.cs` file was updated to use this new class, specifically the `Create` method, to add constructors to the source code. Additionally, the `Arrays.cs` file was updated with a new method for creating and initializing arrays, and the `PlainersSwappingTests.cs` file had code for initializing an array commented out.

Changes:

1. Addition of `CsPlainConstructorBuilder.cs` file: This new file contains the `CsPlainConstructorBuilder` class, which is used to build constructors for classes. It implements the `ICombinedThreeVisitor` interface and contains methods for creating different types of declarations and adding them to the source code. It also contains a `Create` method which is used to create a new instance of the `CsPlainConstructorBuilder` class and add the constructor to the source code.

2. Modification of `CsPlainSourceBuilder.cs` file: The `using AXSharp.Compiler.Cs.Onliner;` directive was added to allow the `CsPlainSourceBuilder` class to use the `CsPlainConstructorBuilder` class. The `CsPlainConstructorBuilder.Create` method was added to the `CreateClassDeclaration` method, creating a new instance of the `CsPlainConstructorBuilder` class and adding the constructor to the source code.

3. Addition of `InstantiateArray` method in `Arrays.cs` file: This new method is used to create a new array and initialize it with a specified initializer function and array bounds.

4. Commenting out of array initialization in `PlainersSwappingTests.cs` file: The code for initializing the `ArrayOfDrives` array was commented out, suggesting that the array is now being initialized elsewhere, possibly in the constructor of the `p` object.

---------

Co-authored-by: PTKu <61538034+PTKu@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants