Skip to content

Commit

Permalink
Can type check simple case.
Browse files Browse the repository at this point in the history
  • Loading branch information
emilyaherbert committed Mar 20, 2023
1 parent 4f8264a commit dcfc1f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
8 changes: 1 addition & 7 deletions sway-core/src/control_flow_analysis/dead_code_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1013,20 +1013,14 @@ fn connect_expression<'eng: 'cfg, 'cfg>(
let fn_decl = decl_engine.get_function(fn_ref);
let mut is_external = false;

// in the case of monomorphized functions, first check if we already have a node for
// it in the namespace. if not then we need to check to see if the namespace contains
// the decl id parents (the original generic non monomorphized decl id).
let exists = false;
todo!();

// find the function in the namespace
let fn_namespace_entry = graph.namespace.get_function(&fn_decl).cloned();

let mut leaves = leaves.to_vec();

// if the parent node exists in this module, then add the monomorphized version
// to the graph.
if fn_namespace_entry.is_none() && exists {
if fn_namespace_entry.is_none() {
let (l_leaves, _new_exit_node) = connect_node(
engines,
&ty::TyAstNode {
Expand Down
6 changes: 3 additions & 3 deletions sway-core/src/language/ty/declaration/declaration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ impl TyDeclaration {
DeclRef::new(
name.clone(),
*decl_id,
type_subst_list.fresh_copy(),
type_subst_list.unscoped_copy(),
decl_span.clone(),
),
vec![],
Expand Down Expand Up @@ -491,7 +491,7 @@ impl TyDeclaration {
DeclRef::new(
name.clone(),
*decl_id,
type_subst_list.fresh_copy(),
type_subst_list.unscoped_copy(),
decl_span.clone(),
),
vec![],
Expand Down Expand Up @@ -527,7 +527,7 @@ impl TyDeclaration {
DeclRef::new(
name.clone(),
*decl_id,
type_subst_list.fresh_copy(),
type_subst_list.unscoped_copy(),
decl_span.clone(),
),
vec![],
Expand Down

0 comments on commit dcfc1f2

Please sign in to comment.