Skip to content

Commit

Permalink
Refactor type id insertion code in associated item/type root resolvers.
Browse files Browse the repository at this point in the history
  • Loading branch information
tritao committed Jun 24, 2024
1 parent 1efaaf4 commit 2c9c53a
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions sway-core/src/semantic_analysis/namespace/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,17 +694,12 @@ impl Root {
self_type: Option<TypeId>,
) -> Result<ResolvedDeclaration, ErrorEmitted> {
let type_info = self.decl_to_type_info(handler, engines, symbol, decl)?;
let type_id = engines
.te()
.insert(engines, type_info, symbol.span().source_id());

self.resolve_associated_type_from_type_id(
handler,
engines,
module,
symbol,
engines
.te()
.insert(engines, type_info, symbol.span().source_id()),
as_trait,
self_type,
handler, engines, module, symbol, type_id, as_trait, self_type,
)
}

Expand All @@ -720,17 +715,12 @@ impl Root {
self_type: Option<TypeId>,
) -> Result<ResolvedDeclaration, ErrorEmitted> {
let type_info = self.decl_to_type_info(handler, engines, symbol, decl)?;
let type_id = engines
.te()
.insert(engines, type_info, symbol.span().source_id());

self.resolve_associated_item_from_type_id(
handler,
engines,
module,
symbol,
engines
.te()
.insert(engines, type_info, symbol.span().source_id()),
as_trait,
self_type,
handler, engines, module, symbol, type_id, as_trait, self_type,
)
}

Expand Down

0 comments on commit 2c9c53a

Please sign in to comment.