Skip to content

Commit

Permalink
Use resolved types.
Browse files Browse the repository at this point in the history
  • Loading branch information
esdrubal committed Jul 15, 2024
1 parent 40e7971 commit 8308dea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
4 changes: 2 additions & 2 deletions sway-core/src/abi_generation/abi_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl TypeId {
}
(TypeInfo::Tuple(fields), TypeInfo::Tuple(resolved_fields)) => {
assert_eq!(fields.len(), resolved_fields.len());
let field_strs = fields
let field_strs = resolved_fields
.iter()
.map(|f| {
if ctx.abi_with_fully_specified_types {
Expand All @@ -47,7 +47,7 @@ impl TypeId {
.collect::<Vec<String>>();
format!("({})", field_strs.join(", "))
}
(TypeInfo::Array(type_arg, count), TypeInfo::Array(_, resolved_count)) => {
(TypeInfo::Array(_, count), TypeInfo::Array(type_arg, resolved_count)) => {
assert_eq!(count.val(), resolved_count.val());
let inner_type = if ctx.abi_with_fully_specified_types {
type_engine.get(type_arg.type_id).abi_str(ctx, engines)
Expand Down
22 changes: 8 additions & 14 deletions sway-core/src/abi_generation/fuel_abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -788,22 +788,16 @@ impl TypeId {

type_arguments
.iter()
.map(|arg| {
.zip(resolved_params.iter())
.map(|(arg, p)| {
Ok(program_abi::TypeApplication {
name: "".to_string(),
type_id: arg.initial_type_id.get_abi_type_id(
handler,
ctx,
engines,
arg.type_id,
)?,
type_arguments: arg.initial_type_id.get_abi_type_arguments(
handler,
ctx,
engines,
types,
arg.type_id,
)?,
type_id: arg
.initial_type_id
.get_abi_type_id(handler, ctx, engines, p.type_id)?,
type_arguments: arg
.initial_type_id
.get_abi_type_arguments(handler, ctx, engines, types, p.type_id)?,
})
})
.collect::<Result<Vec<_>, _>>()?
Expand Down

0 comments on commit 8308dea

Please sign in to comment.