Skip to content

Commit

Permalink
Merge finalized
Browse files Browse the repository at this point in the history
  • Loading branch information
jjcnn committed Oct 11, 2024
1 parent 35f0ba4 commit eb34879
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion sway-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ pub fn parsed_to_ast(
let collection_namespace = Namespace::new(handler, engines, initial_namespace.clone(), true)?;
// Collect the program symbols.

let collection_ctx =
let mut collection_ctx =
ty::TyProgram::collect(handler, engines, parse_program, collection_namespace)?;

// TODO: Eliminate this cloning step?
Expand Down
2 changes: 1 addition & 1 deletion sway-core/src/semantic_analysis/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ impl ty::TySubmodule {

pub fn type_check(
handler: &Handler,
parent_ctx: TypeCheckContext,
mut parent_ctx: TypeCheckContext,
engines: &Engines,
mod_name: ModName,
kind: TreeType,
Expand Down
17 changes: 8 additions & 9 deletions sway-core/src/semantic_analysis/type_check_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ impl<'a> TypeCheckContext<'a> {
///
/// Returns the result of the given `with_submod_ctx` function.
pub fn enter_submodule<T>(
mut self,
&mut self,
handler: &Handler,
mod_name: Ident,
visibility: Visibility,
Expand All @@ -356,8 +356,7 @@ impl<'a> TypeCheckContext<'a> {
// We're checking a submodule, so no need to pass through anything other than the
// namespace and the engines.
let engines = self.engines;
let mut ns = self.namespace_mut();
ns.enter_submodule(
self.namespace.enter_submodule(
handler,
engines,
mod_name.clone(),
Expand All @@ -371,16 +370,16 @@ impl<'a> TypeCheckContext<'a> {
mod_name,
visibility,
module_span,
|submod_collection_ctx| {
|submod_collection_ctx| {
let submod_ctx = TypeCheckContext::from_namespace(
&mut ns,
&mut self.namespace,
submod_collection_ctx,
engines,
experimental,
);
let ret = with_submod_ctx(submod_ctx);
ns.pop_submodule();
ret
self.namespace.pop_submodule();
ret
},
)
}
Expand Down Expand Up @@ -1162,7 +1161,7 @@ impl<'a> TypeCheckContext<'a> {
let type_engine = self.engines.te();
let _decl_engine = self.engines.de();

let type_name = self.engines.help_out(type_id).to_string();
// let type_name = self.engines.help_out(type_id).to_string();
// let problem = type_name == "Bytes" && item_name.as_str() == "len";
// if problem { dbg!(&item_prefix); };

Expand Down Expand Up @@ -1266,7 +1265,7 @@ impl<'a> TypeCheckContext<'a> {
let decl_engine = self.engines.de();
let type_engine = self.engines.te();

let type_name = self.engines.help_out(type_id).to_string();
// let type_name = self.engines.help_out(type_id).to_string();
// let problem = type_name == "Bytes" && method_name.as_str() == "len";
// if problem {
// dbg!(&method_prefix);
Expand Down

0 comments on commit eb34879

Please sign in to comment.