Skip to content

Commit 9261828

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

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
@@ -203,7 +200,10 @@ impl TypeInfo {
203200
"__slice {}",
204201
ty.abi_str(handler, ctx, engines, false)?
205202
)),
206-
Alias { ty, .. } => Ok(ty.abi_str(handler, ctx, engines, false)?),
203+
Alias { .. } => {
204+
// Aliases are handled specially when processing the ABI, so we should never get here.
205+
unreachable!()
206+
}
207207
TraitType {
208208
name,
209209
implemented_in: _,

0 commit comments

Comments
 (0)