Skip to content

Commit 54d01f1

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

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

sway-core/src/abi_generation/abi_str.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ 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())
34+
(_, TypeInfo::Alias { .. }) => {
35+
self_abi_str
3636
}
3737
(TypeInfo::Tuple(fields), TypeInfo::Tuple(resolved_fields)) => {
3838
assert_eq!(fields.len(), resolved_fields.len());
@@ -189,7 +189,10 @@ impl TypeInfo {
189189
Slice(ty) => {
190190
format!("__slice {}", ty.abi_str(ctx, engines, false))
191191
}
192-
Alias { ty, .. } => ty.abi_str(ctx, engines, false),
192+
Alias { .. } => {
193+
// Aliases are handled specially when processing the ABI, so we should never get here.
194+
unreachable!()
195+
}
193196
TraitType {
194197
name,
195198
trait_type_id: _,

0 commit comments

Comments
 (0)