-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: do not discard negative sign from field literals in comptime int…
…erpreter (#7439)
- Loading branch information
1 parent
b26d7f7
commit 1d04f8b
Showing
4 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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/compile_success_empty/regression_7433/Nargo.toml
This file contains 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 = "regression_7433" | ||
type = "bin" | ||
authors = [""] | ||
|
||
[dependencies] |
7 changes: 7 additions & 0 deletions
7
test_programs/compile_success_empty/regression_7433/src/main.nr
This file contains 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 @@ | ||
// These two globals should cancel out. | ||
global positive_global: Field = 17; | ||
global negative_global: Field = -17; // Previously the negative sign here would be dropped so this became 17. | ||
|
||
fn main() { | ||
assert_eq(positive_global + negative_global, 0); | ||
} |