Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(experimental elaborator): Avoid calling add_generics twice on trait methods #5108

Merged
merged 57 commits into from
May 28, 2024
Merged
Changes from 56 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
d0afc12
Add elaborator
jfecher May 2, 2024
1c433ec
Merge branch 'master' into jf/elaborator
jfecher May 3, 2024
225303f
More expressions
jfecher May 6, 2024
29e67a1
Finish each expression kind
jfecher May 7, 2024
0177c12
Merge branch 'master' into jf/elaborator
jfecher May 7, 2024
6b30028
Add compiler flag
jfecher May 8, 2024
7550fb8
Move expressions into their own file
jfecher May 8, 2024
39d23dc
Merge branch 'jf/elaborator' into jf/integrate-elaborator
jfecher May 8, 2024
2e77d87
Connect elaborator
jfecher May 8, 2024
e542d32
Code review
jfecher May 8, 2024
fd287df
Finish removing Scope
jfecher May 8, 2024
73dc473
Merge branch 'jf/elaborator' into jf/integrate-elaborator
jfecher May 8, 2024
9614b87
Finish functions
jfecher May 8, 2024
b44c98a
Add should_panic
jfecher May 8, 2024
9579646
clippy
jfecher May 8, 2024
e4d5f61
Fix test
jfecher May 8, 2024
556e6ef
Fix test
jfecher May 9, 2024
7487b03
Elaborate impls
jfecher May 9, 2024
82d5871
Fix yet another missed line
jfecher May 9, 2024
a3872e0
Merge branch 'jf/integrate-elaborator' into jf/elaborator-impls
jfecher May 9, 2024
3fb05dc
Merge branch 'master' into jf/integrate-elaborator
jfecher May 9, 2024
4fa4677
Merge branch 'jf/integrate-elaborator' into jf/elaborator-impls
jfecher May 9, 2024
e9e69f4
Resolve weird git merge
jfecher May 9, 2024
d7d91ae
Wrong arg order
jfecher May 9, 2024
e9afa1a
Merge branch 'jf/integrate-elaborator' into jf/elaborator-impls
jfecher May 9, 2024
13564f8
Merge branch 'master' into jf/elaborator-impls
jfecher May 9, 2024
75c6451
Code review
jfecher May 10, 2024
bbecf41
Start work on traits + types (+ globals)?
jfecher May 10, 2024
0029558
Merge branch 'master' into jf/elaborator-types
jfecher May 21, 2024
7a37bf3
Add globals
jfecher May 21, 2024
464d58c
Format
jfecher May 21, 2024
ba893ae
Merge branch 'jf/elaborator-types' into jf/elaborator-globals
jfecher May 21, 2024
397fe78
Copy over comments from dc_crate
jfecher May 22, 2024
afcf26e
Remove unneeded comment
jfecher May 22, 2024
1f3e79b
Merge branch 'master' into jf/elaborator-globals
jfecher May 22, 2024
8522936
Re-add accidentally removed collect_traits call
jfecher May 22, 2024
bbb7228
Fix panic in the elaborator
jfecher May 22, 2024
1f9b6d0
Merge branch 'master' into jf/elaborator-fixes
jfecher May 22, 2024
78e6a27
Undo unnecessary change
jfecher May 22, 2024
3b59749
Remove more unnecessary code
jfecher May 22, 2024
bf999d9
Remove unnecessary import
jfecher May 22, 2024
7be1561
Remove outdated assert
jfecher May 22, 2024
f48280d
Merge branch 'master' into jf/elaborator-fixes
jfecher May 22, 2024
fadc085
Fix issue with function generics
jfecher May 23, 2024
f0d249a
Clippy
jfecher May 23, 2024
68ccf9c
Add missed field in test
jfecher May 23, 2024
aa6d581
Fix structs not recovering generics length
jfecher May 23, 2024
f519ced
Don't check return type for trait methods
jfecher May 23, 2024
4e6490c
Fix more errors
jfecher May 24, 2024
38f20e9
Clippy
jfecher May 24, 2024
79aaeb7
Avoid defining globals twice
jfecher May 24, 2024
2303635
Move code to declare trait impls earlier
jfecher May 24, 2024
1451341
Merge branch 'master' into jf/elaborator-fixes6
jfecher May 24, 2024
e35d9a5
Don't add_generics on trait methods twice
jfecher May 24, 2024
25ee0d7
Merge branch 'master' into jf/elaborator-fixes7
jfecher May 28, 2024
67add01
Merge branch 'master' into jf/elaborator-fixes7
jfecher May 28, 2024
13173e8
fix(experimental elaborator): Fix panic during monomorphization (#5126)
jfecher May 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions compiler/noirc_frontend/src/elaborator/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ impl<'context> Elaborator<'context> {
let name_span = the_trait.name.span();

this.add_existing_generic("Self", name_span, self_typevar);
this.add_generics(generics);
this.self_type = Some(self_type.clone());

let func_id = unresolved_trait.method_ids[&name.0.contents];
Expand All @@ -101,8 +100,10 @@ impl<'context> Elaborator<'context> {
func_id,
);

let arguments = vecmap(parameters, |param| this.resolve_type(param.1.clone()));
let return_type = this.resolve_type(return_type.get_type().into_owned());
let func_meta = this.interner.function_meta(&func_id);

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

let generics = vecmap(&this.generics, |(_, type_var, _)| type_var.clone());

Expand Down
Loading