-
Notifications
You must be signed in to change notification settings - Fork 409
fix(defunctionalize): Create a placeholder function for first-class function calls with no variants #8697
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
fix(defunctionalize): Create a placeholder function for first-class function calls with no variants #8697
Changes from 15 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
6170755
gen dummy func for no variants
vezenovm 2c83863
imrpvoe comments
vezenovm 2229efd
Merge branch 'master' into mv/empty-array-of-lambdas-2
vezenovm 8e5fbc2
remove unreachable funcs after defunctionalize
vezenovm 0560ad1
change type of field
vezenovm 2b9c759
use use apply functions for dummy
vezenovm 8a6ae34
Update compiler/noirc_evaluator/src/ssa/opt/defunctionalize.rs
vezenovm 563c8a2
Update compiler/noirc_evaluator/src/ssa/opt/defunctionalize.rs
vezenovm 48f600f
bump timeout
vezenovm 4c37881
Merge remote-tracking branch 'origin/mv/empty-array-of-lambdas-2' int…
vezenovm d2741ef
merge conflicts
vezenovm 96e649d
fix dummy placeholder function return values for a well formed IR
vezenovm 95fbc92
dont need additional remove unreachable
vezenovm f21f861
remove top line import
vezenovm d31f0dd
Merge branch 'master' into mv/empty-array-of-lambdas-2
vezenovm 6c7b80e
Update compiler/noirc_evaluator/src/ssa/opt/defunctionalize.rs
vezenovm 39d86ac
Update compiler/noirc_evaluator/src/ssa/opt/defunctionalize.rs
vezenovm 85583bf
Merge branch 'master' into mv/empty-array-of-lambdas-2
vezenovm b8e6528
don't store when returning dummy ref
vezenovm 6954395
Merge branch 'master' into mv/empty-array-of-lambdas-2
vezenovm 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
6 changes: 6 additions & 0 deletions
6
test_programs/execution_failure/lambda_from_empty_array/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,6 @@ | ||
| [package] | ||
| name = "lambda_from_empty_array" | ||
| type = "bin" | ||
| authors = [""] | ||
|
|
||
| [dependencies] |
11 changes: 11 additions & 0 deletions
11
test_programs/execution_failure/lambda_from_empty_array/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,11 @@ | ||
| // Regression from issue #5503 (https://github.com/noir-lang/noir/issues/5503) | ||
| fn main() { | ||
| let lambdas: [fn((u32)) -> (u32, [u32; 2]); 0] = []; | ||
| let _ = lambdas[0]((0)); | ||
|
|
||
| let lambdas: [fn((u32)) -> (&mut u32); 0] = []; | ||
| let _ = lambdas[0]((1)); | ||
|
|
||
| let lambdas: [fn((u32)) -> (fn((u32)) -> ()); 0] = []; | ||
| let _ = lambdas[0]((2)); | ||
| } |
6 changes: 6 additions & 0 deletions
6
test_programs/execution_failure/lambda_from_empty_array_dyn_index/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,6 @@ | ||
| [package] | ||
| name = "lambda_from_empty_array_dyn_index" | ||
| type = "bin" | ||
| authors = [""] | ||
|
|
||
| [dependencies] |
1 change: 1 addition & 0 deletions
1
test_programs/execution_failure/lambda_from_empty_array_dyn_index/Prover.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 @@ | ||
| x = 1 |
7 changes: 7 additions & 0 deletions
7
test_programs/execution_failure/lambda_from_empty_array_dyn_index/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,7 @@ | ||
| // Regression from issue #5503 (https://github.com/noir-lang/noir/issues/5503), | ||
| // except this test uses a dynamic index for the array access. | ||
| fn main(x: u32) { | ||
| let lambdas: [fn(()) -> (); 0] = []; | ||
| lambdas[x - 1](()); | ||
| } | ||
|
|
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
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.