Skip to content

Commit

Permalink
fix: don't crash on broken impl syntax (#7512)
Browse files Browse the repository at this point in the history
  • Loading branch information
asterite authored Feb 25, 2025
1 parent 6f78848 commit 677c10c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/noirc_frontend/src/elaborator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2134,7 +2134,7 @@ impl<'context> Elaborator<'context> {
let span = location.span;
let found = trait_impl.r#trait.typ.to_string();
self.push_err(ResolverError::ExpectedTrait { span, found }, location.file);
continue;
(None, GenericTypeArgs::default(), location)
}
};

Expand Down
7 changes: 7 additions & 0 deletions test_programs/compile_failure/broken_impl/Nargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "broken_impl"
type = "bin"
authors = [""]
compiler_version = ">=0.26.0"

[dependencies]
2 changes: 2 additions & 0 deletions test_programs/compile_failure/broken_impl/src/main.nr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// This used to crash the compiler
impl< Foo for

0 comments on commit 677c10c

Please sign in to comment.