File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
sway-core/src/abi_generation Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -658,12 +658,31 @@ fn generate_concrete_type_declaration(
658658
659659 let ( type_field, concrete_type_id) =
660660 type_id. get_abi_type_field_and_concrete_id ( handler, ctx, engines, resolved_type_id) ?;
661+
662+ let type_engine = engines. te ( ) ;
663+ let alias_of = match & * type_engine. get ( resolved_type_id) {
664+ TypeInfo :: Alias { ty, .. } => {
665+ // Ensure the underlying representation has a declaration first
666+ let target_ctid = generate_concrete_type_declaration (
667+ handler,
668+ ctx,
669+ engines,
670+ metadata_types,
671+ concrete_types,
672+ ty. initial_type_id ( ) ,
673+ ty. type_id ( ) ,
674+ ) ?;
675+ Some ( target_ctid)
676+ }
677+ _ => None ,
678+ } ;
679+
661680 let concrete_type_decl = TypeConcreteDeclaration {
662681 type_field,
663682 concrete_type_id : concrete_type_id. clone ( ) ,
664683 metadata_type_id,
665684 type_arguments,
666- alias_of : None ,
685+ alias_of,
667686 } ;
668687
669688 concrete_types. push ( concrete_type_decl) ;
You can’t perform that action at this time.
0 commit comments