-
Notifications
You must be signed in to change notification settings - Fork 381
feat: TypeVariableKind for just Integers #4118
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 25 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
9510292
WIP: first pass of adding a TypeVariableKind specifically for Integer(s)
michaeljklein ffb8301
WIP working through cargo errors
michaeljklein 5a9e434
Merge branch 'master' into michaeljklein/integer-kind
michaeljklein c8ebfb9
revert unrelated test programs change, update printing of TypeVariabl…
michaeljklein a169552
Merge branch 'master' into michaeljklein/integer-kind
michaeljklein 940ec3a
wip implementing type check rules for Kind::Integer
michaeljklein 5a1b8b6
Merge branch 'master' into michaeljklein/integer-kind
michaeljklein 56886b0
resolve typing with TypeVariableKind::Integer (bindings), update borr…
michaeljklein 83e776c
Merge branch 'master' into michaeljklein/integer-kind
michaeljklein 4a2b99e
add test programs for regressions
michaeljklein 442051d
Merge branch 'master' into michaeljklein/integer-kind
michaeljklein db62dfc
ensure IntegerOrField and Integer TypeVariableKind's are equivalent w…
michaeljklein cc739c3
Merge branch 'master' into michaeljklein/integer-kind
michaeljklein 5a9781e
Merge branch 'master' into michaeljklein/integer-kind
michaeljklein d7c8098
Merge branch 'master' into michaeljklein/integer-kind
michaeljklein 130d19d
Merge branch 'master' into michaeljklein/integer-kind
michaeljklein 7102e4d
Merge branch 'master' into michaeljklein/integer-kind
michaeljklein 78747a2
Merge branch 'master' into michaeljklein/integer-kind
TomAFrench c98ad67
Merge branch 'master' into michaeljklein/integer-kind
michaeljklein 6e34306
Merge branch 'master' into michaeljklein/integer-kind
michaeljklein 082d3cc
Update test_programs/compile_success_empty/infer_int_loop_bounds/src/…
michaeljklein f0918c8
Update test_programs/compile_success_empty/int_or_field_casting_loop/…
michaeljklein a913bb4
Update compiler/noirc_frontend/src/hir_def/types.rs
michaeljklein e6eb976
update comment w/ type checking context
michaeljklein d404ad4
Merge branch 'master' into michaeljklein/integer-kind
michaeljklein 7cdacc2
Update compiler/noirc_frontend/src/hir_def/types.rs
michaeljklein ea3fd62
remove tests that pass on master branch
michaeljklein 126965a
Merge branch 'master' into michaeljklein/integer-kind
michaeljklein 77fc805
Merge branch 'master' into michaeljklein/integer-kind
michaeljklein 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
test_programs/compile_success_empty/infer_int_loop_bounds/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 = "infer_int_loop_bounds" | ||
| type = "bin" | ||
| authors = [""] | ||
| compiler_version = ">=0.23.0" | ||
|
|
||
| [dependencies] |
13 changes: 13 additions & 0 deletions
13
test_programs/compile_success_empty/infer_int_loop_bounds/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,13 @@ | ||
| // issue #4290 | ||
| fn loop_from<N, K>(_arr: [Field; N], _another: [Field; K]) -> u32 { | ||
| let mut acc = 0; | ||
| // N and K were of type Field but the iterator is u32 | ||
| for i in N..K { | ||
| acc += i; | ||
| } | ||
| acc | ||
| } | ||
|
|
||
| fn main() { | ||
| let _ = loop_from([0; 10], [0; 20]); | ||
| } |
7 changes: 7 additions & 0 deletions
7
test_programs/compile_success_empty/int_or_field_casting_loop/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 = "int_or_field_casting_loop" | ||
| type = "bin" | ||
| authors = [""] | ||
| compiler_version = ">=0.23.0" | ||
|
|
||
| [dependencies] |
10 changes: 10 additions & 0 deletions
10
test_programs/compile_success_empty/int_or_field_casting_loop/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,10 @@ | ||
| // issue #3639 | ||
| fn main() { | ||
| for i in 0..8 { | ||
| for j in 0..8 { | ||
| if (i as u64 + j as u64 < 8) { | ||
| // pass | ||
| } | ||
| } | ||
| } | ||
| } |
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
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.