Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "lambda_call_assign_in_lambda"
type = "bin"
authors = [""]

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Regression for issue #5212 (https://github.com/noir-lang/noir/issues/5212)
fn main() {
let lambda1 = || 1;

// Previous bug: Compiler panic when you create a variable in a lambda with another lambda call as its value
let _ = || { let _: u8 = lambda1(); };

// No panic if the variable is created before we assign its value as the lambda call
let _ = || {
let mut var3: u8 = 1;
var3 = lambda1();
};

// No panic with a function call that has the same behavior
let _ = || { let _: u8 = func(); };

// No panic outside a lambda code block
let _: u8 = lambda1();
}

fn func() -> u8 {
1
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading