-
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!: Infer globals to be u32 when used in a type (noir-lang/noir#6083)
fix: Fix comptime type formatting (noir-lang/noir#6079) fix: don't crash on untyped global used as array length (noir-lang/noir#6076) feat(perf): Remove unused loads in mem2reg and last stores per function (noir-lang/noir#5925) fix: Correct stack trace order in comptime assertion failures (noir-lang/noir#6066) chore!: removing implicit numeric generics (noir-lang/noir#5837) fix: Always parse all tokens from quoted token streams (noir-lang/noir#6064) fix: Update databus in flattening (noir-lang/noir#6063) fix: Be more lenient with semicolons on interned expressions (noir-lang/noir#6062) feat: check unconstrained trait impl method matches (noir-lang/noir#6057) chore: remove unused TypeVariableKind::Constant (noir-lang/noir#6053)
- Loading branch information
Showing
12 changed files
with
185 additions
and
52 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 @@ | ||
19eef30cdbd8a3a4671aabbbe66b5481a5dec3f7 | ||
78262c96d5b116c77e50653f9059da60824db812 |
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
...-repo/test_programs/compile_failure/global_without_a_type_used_as_array_length/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 = "global_without_a_type_used_as_array_length" | ||
type = "bin" | ||
authors = [""] | ||
compiler_version = ">=0.33.0" | ||
|
||
[dependencies] |
2 changes: 2 additions & 0 deletions
2
...repo/test_programs/compile_failure/global_without_a_type_used_as_array_length/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,2 @@ | ||
global BAR = OOPS; | ||
global X: [Field; BAR] = []; |
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_success_empty/regression_6077/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 = "regression_6077" | ||
type = "bin" | ||
authors = [""] | ||
compiler_version = ">=0.30.0" | ||
|
||
[dependencies] |
1 change: 1 addition & 0 deletions
1
noir/noir-repo/test_programs/compile_success_empty/regression_6077/Prover.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 @@ | ||
a = 0 |
28 changes: 28 additions & 0 deletions
28
noir/noir-repo/test_programs/compile_success_empty/regression_6077/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,28 @@ | ||
struct WeirdStruct<T, U> { | ||
a: T, | ||
b: U, | ||
} | ||
|
||
#[mangle_fn] | ||
pub fn my_fn() -> [u8; 3] { | ||
[0; 3] | ||
} | ||
|
||
comptime fn mangle_fn(f: FunctionDefinition) { | ||
let return_type = f.return_type(); | ||
|
||
// This relies on how types are displayed | ||
let generics = f"Field,{return_type}".quoted_contents(); | ||
let new_return_type = quote { WeirdStruct<$generics>}.as_type(); | ||
|
||
let new_body = quote { | ||
{ | ||
WeirdStruct { a: 1, b: [0;3] } | ||
} | ||
}.as_expr().unwrap(); | ||
|
||
f.set_return_type(new_return_type); | ||
f.set_body(new_body); | ||
} | ||
|
||
fn main() {} |