Skip to content

Commit

Permalink
Fix double trait error
Browse files Browse the repository at this point in the history
  • Loading branch information
jfecher committed Jan 13, 2025
1 parent 59666ba commit ec865ad
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions compiler/noirc_frontend/src/elaborator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -776,10 +776,16 @@ impl<'context> Elaborator<'context> {
fn add_missing_named_generics(&mut self, bound: &mut TraitBound) -> Vec<ResolvedGeneric> {
let mut added_generics = Vec::new();

let Some(the_trait) = self.lookup_trait_or_error(bound.trait_path.clone()) else {
return added_generics;
let Ok(item) = self.resolve_path_or_error(bound.trait_path.clone()) else {
return Vec::new();
};

let PathResolutionItem::Trait(trait_id) = item else {
return Vec::new();
};

let the_trait = self.get_trait_mut(trait_id);

if the_trait.associated_types.len() > bound.trait_generics.named_args.len() {
for associated_type in the_trait.associated_types.clone() {
if !bound
Expand Down

0 comments on commit ec865ad

Please sign in to comment.