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

struct_contains_array must calculate transitive dependencies #1500

Open
gmarcosb opened this issue Dec 23, 2024 · 0 comments
Open

struct_contains_array must calculate transitive dependencies #1500

gmarcosb opened this issue Dec 23, 2024 · 0 comments

Comments

@gmarcosb
Copy link
Collaborator

gmarcosb commented Dec 23, 2024

ZAP templates currently decide how to generate Type vs DecodableType based on struct_contains_array

However, this only works if the array is a field in the struct; if the array is contained > 1 level (a struct referencing a struct with an array field), the resulting cluster-objects generated file is invalid

Fix @ #1501

Effectively, DecodableType is aliased to Type if a struct does not have an array field

Problem is: TransportOptionsStruct referenced from the command does not have an array, so Type ends up being aliased to DecodableType - but it contains a field to a struct (TransportTriggerOptionsStruct) which does have an array, an then we get a compiler failure

When deciding whether TransportOptionsStruct should have its DecodableType aliased to Type, we also need to check if its children (such as TransportTriggerOptionsStruct) are also eligible, otherwise it cannot alias

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

No branches or pull requests

1 participant