Skip to content

fix: added header generation support for ref_to arrays#1652

Merged
Angus-Bethke-Bachmann merged 3 commits intomasterfrom
anbt/PRG-3964
Apr 1, 2026
Merged

fix: added header generation support for ref_to arrays#1652
Angus-Bethke-Bachmann merged 3 commits intomasterfrom
anbt/PRG-3964

Conversation

@Angus-Bethke-Bachmann
Copy link
Copy Markdown
Contributor

Changed

  • Added header generation support for ref_to arrays

Testing

  • Added new test case for ref_to arrays

@Angus-Bethke-Bachmann Angus-Bethke-Bachmann linked an issue Mar 30, 2026 that may be closed by this pull request
@ghaith ghaith changed the title fix added header generation support for ref_to arrays fix: added header generation support for ref_to arrays Mar 31, 2026
if data_type_is_system_generated(referenced_type_name) {
self.get_user_type_variable(
get_user_generated_type_by_name(referenced_type_name, user_types)
.expect("This system generated type must be here!"),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little confused by this expect message. We call methods/functions referencing user types, but if we can't find it we crash with a message saying the system generated type must exist.

Another note: get_user_type_variable returns Option<Variable> - can we propagate any potential None we encounter in the function-body to the caller and handle it there instead of crashing? Since this is just for the header-generation, I don't see it as blocking - just wondering.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite right, that expect should not have been there. I have refactored that call to correctly invoke the recursive call only in the condition I need it to. The "None" is propagated back upstream now as well, and I am logging a warning if "None" was returned.

@Angus-Bethke-Bachmann Angus-Bethke-Bachmann merged commit 72b568b into master Apr 1, 2026
33 checks passed
@Angus-Bethke-Bachmann Angus-Bethke-Bachmann deleted the anbt/PRG-3964 branch April 1, 2026 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

REF_TO array is incorrectly generated

2 participants