Skip to content

Commit c27c8c7

Browse files
committed
Do not process inner aliased types when generating ABI type string.
1 parent e6a97ad commit c27c8c7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sway-core/src/abi_generation/abi_str.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ impl TypeId {
3535
| (TypeInfo::Custom { .. }, TypeInfo::Enum { .. }) => type_engine
3636
.get(resolved_type_id)
3737
.abi_str(handler, ctx, engines, true),
38-
(_, TypeInfo::Alias { ty, .. }) => {
39-
ty.type_id()
40-
.get_abi_type_str(handler, ctx, engines, ty.type_id())
41-
}
38+
(_, TypeInfo::Alias { .. }) => Ok(self_abi_str),
4239
(TypeInfo::Tuple(fields), TypeInfo::Tuple(resolved_fields)) => {
4340
assert_eq!(fields.len(), resolved_fields.len());
4441
let field_strs = resolved_fields
@@ -200,7 +197,10 @@ impl TypeInfo {
200197
"__slice {}",
201198
ty.abi_str(handler, ctx, engines, false)?
202199
)),
203-
Alias { ty, .. } => Ok(ty.abi_str(handler, ctx, engines, false)?),
200+
Alias { .. } => {
201+
// Aliases are handled specially when processing the ABI, so we should never get here.
202+
unreachable!()
203+
}
204204
TraitType {
205205
name,
206206
trait_type_id: _,

0 commit comments

Comments
 (0)