Skip to content

Commit 136282a

Browse files
committed
Generate aliasOf field when processing aliased types for ABI generation.
1 parent b1d0273 commit 136282a

File tree

16 files changed

+416
-154
lines changed

16 files changed

+416
-154
lines changed

forc-pkg/src/pkg.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,6 +1811,8 @@ pub fn compile(
18111811
abi_with_callpaths: true,
18121812
type_ids_to_full_type_str: HashMap::<String, String>::new(),
18131813
unique_names: HashMap::new(),
1814+
metadata_declaration_cache: HashMap::new(),
1815+
concrete_declaration_cache: HashMap::new(),
18141816
},
18151817
engines,
18161818
if experimental.new_encoding {

sway-core/src/abi_generation/abi_str.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ impl TypeId {
3737
| (TypeInfo::Custom { .. }, TypeInfo::Enum { .. }) => type_engine
3838
.get(resolved_type_id)
3939
.abi_str(handler, ctx, engines, true),
40-
(_, TypeInfo::Alias { ty, .. }) => ty
41-
.type_id
42-
.get_abi_type_str(handler, ctx, engines, ty.type_id),
40+
(_, TypeInfo::Alias { .. }) => Ok(self_abi_str),
4341
(TypeInfo::Tuple(fields), TypeInfo::Tuple(resolved_fields)) => {
4442
assert_eq!(fields.len(), resolved_fields.len());
4543
let field_strs = resolved_fields
@@ -204,7 +202,7 @@ impl TypeInfo {
204202
"__slice {}",
205203
ty.abi_str(handler, ctx, engines, false)?
206204
)),
207-
Alias { ty, .. } => Ok(ty.abi_str(handler, ctx, engines, false)?),
205+
Alias { name, .. } => Ok(name.to_string()),
208206
TraitType {
209207
name,
210208
implemented_in: _,

0 commit comments

Comments
 (0)