Skip to content

Commit

Permalink
Merge branch 'ab/type-check-trait-default-methods' of github.com:noir…
Browse files Browse the repository at this point in the history
…-lang/noir into ab/type-check-trait-default-methods
  • Loading branch information
asterite committed Dec 23, 2024
2 parents 03b5c9a + 3520970 commit f88f28a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compiler/noirc_frontend/src/elaborator/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ impl<'context> Elaborator<'context> {
{
self.recover_generics(|this| {
let the_trait = this.interner.get_trait(trait_id);
let the_trait_where_clause = the_trait.where_clause.clone();
let the_trait_constraint = the_trait.as_constraint(the_trait.name.span());
let self_typevar = the_trait.self_type_typevar.clone();
let name_span = the_trait.name.span();

Expand Down Expand Up @@ -146,7 +148,9 @@ impl<'context> Elaborator<'context> {
this.interner.set_doc_comments(id, item.doc_comments.clone());
}

let func_meta = this.interner.function_meta(&func_id);
let func_meta = this.interner.function_meta_mut(&func_id);
func_meta.trait_constraints.push(the_trait_constraint);
func_meta.trait_constraints.extend(the_trait_where_clause);

let arguments = vecmap(&func_meta.parameters.0, |(_, typ, _)| typ.clone());
let return_type = func_meta.return_type().clone();
Expand Down

0 comments on commit f88f28a

Please sign in to comment.