Skip to content

[Proposal] Consider allowing external generic structs to be instantiated in the parent program #28726

Description

@mohammadfawaz

💥 Proposal

For example, if this is a dependent:

program foo.aleo {
    struct Bar::[N: u32] { x: u32 };
    
    transition baz(b: Bar::[5]) {}
}

Then I should be able to import foo.aleo and use Bar::[5] directly in a parent program. This, however, only works because Bar::[5] is actually instantiated in the child program. Therefore, using Bar::[3] in the parent program does not work.

One way to implement the above is by converting Bar::[5] to its legalized name as done in #28712 (using the has of the const params etc.) and then look for a struct with that name in the dependent program.

Metadata

Metadata

Assignees

Labels

proposalA proposal for something new.🚀 featureA new feature.🧱 Core CompilerAnything related to the core compiler including parsing, analysis, transforms, codegen, etc.
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions