-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Allow macros to change types on each iteration of a comptime loop (
noir-lang/noir#6105) chore: Schnorr signature verification in Noir (noir-lang/noir#5437) feat: Implement solver for mov_registers_to_registers (noir-lang/noir#6089)
- Loading branch information
Showing
11 changed files
with
182 additions
and
116 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
4170c55019bd27fd51be8a46637514dfe86de53c | ||
0864e7c945089cc06f8cc9e5c7d933c465d8c892 |
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
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
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
7 changes: 7 additions & 0 deletions
7
noir/noir-repo/test_programs/compile_failure/macro_result_type/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,7 @@ | ||
[package] | ||
name = "macro_result_type" | ||
type = "bin" | ||
authors = [""] | ||
compiler_version = ">=0.34.0" | ||
|
||
[dependencies] |
13 changes: 13 additions & 0 deletions
13
noir/noir-repo/test_programs/compile_failure/macro_result_type/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,13 @@ | ||
fn main() { | ||
comptime | ||
{ | ||
let signature = "hello".as_ctstring(); | ||
let string = signature.as_quoted_str!(); | ||
let result = half(string); | ||
assert_eq(result, 2); | ||
} | ||
} | ||
|
||
comptime fn half<let N: u32>(_s: str<N>) -> u32 { | ||
N / 2 | ||
} |
7 changes: 7 additions & 0 deletions
7
...r-repo/test_programs/compile_success_empty/comptime_change_type_each_iteration/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,7 @@ | ||
[package] | ||
name = "comptime_change_type_each_iteration" | ||
type = "bin" | ||
authors = [""] | ||
compiler_version = ">=0.34.0" | ||
|
||
[dependencies] |
19 changes: 19 additions & 0 deletions
19
...-repo/test_programs/compile_success_empty/comptime_change_type_each_iteration/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,19 @@ | ||
fn main() { | ||
comptime | ||
{ | ||
for i in 9..11 { | ||
// Lengths are different on each iteration: | ||
// foo9, foo10 | ||
let name = f"foo{i}".as_ctstring().as_quoted_str!(); | ||
|
||
// So to call `from_signature` we need to delay the type check | ||
// by quoting the function call so that we re-typecheck on each iteration | ||
let hash = std::meta::unquote!(quote { from_signature($name) }); | ||
assert(hash > 3); | ||
} | ||
} | ||
} | ||
|
||
fn from_signature<let N: u32>(_signature: str<N>) -> u32 { | ||
N | ||
} |
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