-
Notifications
You must be signed in to change notification settings - Fork 705
Open
Labels
featureA new feature.A new feature.🖥️ CLIAnything related to the Leo CLI.Anything related to the Leo CLI.🧬 JSON ABIEverything related to the JSON ABIEverything related to the JSON ABI
Description
The ABI currently does not properly represent const generic structs. When a const generic struct is used in a transition, it appears in its monomorphized form rather than preserving the generic type with concrete arguments.
Example
struct Foo::[N: u32] { a: [u32; N] }transition bar(f0: Foo::[42]) -> Foo::[42] { .. }Desired behavior
- Type declarations should include const parameters (e.g.,
Foowith parameterN: u32). - Type references in transitions should include concrete arguments (e.g.,
Foo::[42]).
Changes needed
- Add const_params: Vec to Struct for type declarations.
- Add const_args: Vec to StructRef for type references.
Possible Approach
May require a multi-phased ABI generation:
- After type-checking: capture generic type declarations with their const parameters.
- After ConstPropUnrollAndMorphing: capture concrete const arguments in transition signatures.
Related discussion: #29064
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureA new feature.A new feature.🖥️ CLIAnything related to the Leo CLI.Anything related to the Leo CLI.🧬 JSON ABIEverything related to the JSON ABIEverything related to the JSON ABI