-
Notifications
You must be signed in to change notification settings - Fork 388
feat: error if generic type parameter in impl is not mentioned in self type #6388
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1e094ca
Make sure UnresolvedTypeExpression is visited by the Visitor
asterite c41df60
Error if generic type in impl doesn't show up in self type
asterite 76bea47
Merge branch 'master' into ab/unconstrained-type-parameter
asterite 3fca679
Merge branch 'master' into ab/unconstrained-type-parameter
TomAFrench ebde7af
Bump Aztec-Packages commit
asterite acc3756
Merge branch 'ab/unconstrained-type-parameter' of github.com:noir-lan…
asterite ea3dfb7
Bump aztec-package commit using script
asterite 5618f22
Merge branch 'master' into ab/unconstrained-type-parameter
asterite 18f866a
Add a test with numeric generic
asterite 495d125
Merge branch 'ab/unconstrained-type-parameter' of github.com:noir-lan…
asterite e7cb9e1
Merge branch 'master' into ab/unconstrained-type-parameter
asterite e1aaa82
Merge branch 'master' into ab/unconstrained-type-parameter
asterite e0be5a8
Merge branch 'master' into ab/unconstrained-type-parameter
asterite e18adb2
Update generated tests
asterite File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...ams/compile_failure/noirc_frontend_tests_unconstrained_numeric_generic_in_impl/Nargo.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
|
|
||
| [package] | ||
| name = "noirc_frontend_tests_unconstrained_numeric_generic_in_impl" | ||
| type = "bin" | ||
| authors = [""] | ||
|
|
||
| [dependencies] |
9 changes: 9 additions & 0 deletions
9
...ms/compile_failure/noirc_frontend_tests_unconstrained_numeric_generic_in_impl/src/main.nr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
|
|
||
| pub struct Foo {} | ||
|
|
||
| impl<let N: u32> Foo {} | ||
|
|
||
| fn main() { | ||
| let _ = Foo {}; | ||
| } | ||
|
|
1 change: 1 addition & 0 deletions
1
...s/compile_failure/noirc_frontend_tests_unconstrained_numeric_generic_in_impl/src_hash.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 10648545254261603633 |
8 changes: 8 additions & 0 deletions
8
...ams/compile_failure/noirc_frontend_tests_unconstrained_numeric_generic_in_impl/stderr.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| error: The type parameter `N` is not constrained by the impl trait, self type, or predicates | ||
| ┌─ src/main.nr:4:18 | ||
| │ | ||
| 4 │ impl<let N: u32> Foo {} | ||
| │ - Hint: remove the `N` type parameter | ||
| │ | ||
|
|
||
| Aborting due to 1 previous error |
7 changes: 7 additions & 0 deletions
7
...rams/compile_failure/noirc_frontend_tests_unconstrained_type_parameter_in_impl/Nargo.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
|
|
||
| [package] | ||
| name = "noirc_frontend_tests_unconstrained_type_parameter_in_impl" | ||
| type = "bin" | ||
| authors = [""] | ||
|
|
||
| [dependencies] |
9 changes: 9 additions & 0 deletions
9
...ams/compile_failure/noirc_frontend_tests_unconstrained_type_parameter_in_impl/src/main.nr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
|
|
||
| pub struct Foo<T> {} | ||
|
|
||
| impl<T, U> Foo<T> {} | ||
|
|
||
| fn main() { | ||
| let _ = Foo {}; | ||
| } | ||
|
|
1 change: 1 addition & 0 deletions
1
...ms/compile_failure/noirc_frontend_tests_unconstrained_type_parameter_in_impl/src_hash.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 5158513121244495309 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.