Skip to content

Commit 612f027

Browse files
committed
Do not process inner aliased types when generating ABI type string.
1 parent a0f2f2e commit 612f027

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sway-core/src/abi_generation/abi_str.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ impl TypeId {
3131
| (TypeInfo::Custom { .. }, TypeInfo::Enum { .. }) => type_engine
3232
.get(resolved_type_id)
3333
.abi_str(ctx, engines, true),
34-
(_, TypeInfo::Alias { ty, .. }) => {
35-
ty.type_id().get_abi_type_str(ctx, engines, ty.type_id())
36-
}
34+
(_, TypeInfo::Alias { .. }) => self_abi_str,
3735
(TypeInfo::Tuple(fields), TypeInfo::Tuple(resolved_fields)) => {
3836
assert_eq!(fields.len(), resolved_fields.len());
3937
let field_strs = resolved_fields
@@ -189,7 +187,10 @@ impl TypeInfo {
189187
Slice(ty) => {
190188
format!("__slice {}", ty.abi_str(ctx, engines, false))
191189
}
192-
Alias { ty, .. } => ty.abi_str(ctx, engines, false),
190+
Alias { .. } => {
191+
// Aliases are handled specially when processing the ABI, so we should never get here.
192+
unreachable!()
193+
}
193194
TraitType {
194195
name,
195196
trait_type_id: _,

0 commit comments

Comments
 (0)