-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
76 additions
and
23 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
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
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
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
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 | ||
} |
12 changes: 0 additions & 12 deletions
12
test_programs/compile_success_empty/macro_result_type/t.rs
This file was deleted.
Oops, something went wrong.