Skip to content

Commit

Permalink
Optimize decl id insertion in method application.
Browse files Browse the repository at this point in the history
  • Loading branch information
tritao committed Sep 12, 2023
1 parent 60ca1a6 commit ffe7857
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use crate::{
decl_engine::{DeclEngineInsert, DeclRefFunction, ReplaceDecls, UpdateConstantExpression},
decl_engine::{
engine::DeclEngineReplace, DeclEngineInsert, DeclRefFunction, ReplaceDecls,
UpdateConstantExpression,
},
language::{parsed::*, ty, *},
namespace::TryInsertingTraitImplOnFailure,
semantic_analysis::{type_check_context::EnforceTypeArguments, *},
Expand Down Expand Up @@ -346,16 +349,14 @@ pub(crate) fn type_check_method_application(

method.replace_decls(&decl_mapping, handler, &mut ctx)?;
let return_type = method.return_type.type_id;
let new_decl_ref = decl_engine
.insert(method)
.with_parent(decl_engine, (*decl_ref.id()).into());
decl_engine.replace(*decl_ref.id(), method);

let exp = ty::TyExpression {
expression: ty::TyExpressionVariant::FunctionApplication {
call_path,
contract_call_params: contract_call_params_map,
arguments: typed_arguments_with_names,
fn_ref: new_decl_ref,
fn_ref: decl_ref,
selector,
type_binding: Some(method_name_binding.strip_inner()),
call_path_typeid: Some(call_path_typeid),
Expand Down

0 comments on commit ffe7857

Please sign in to comment.