llvm issue with try when bool is combined #1467

This commit is contained in:
Christoffer Lerno
2024-09-20 20:15:44 +02:00
parent cda6ffea1e
commit ac479c7e40
3 changed files with 21 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
module unwrapping;
fn bool! get_bool()
{
return true;
}
fn void! bool_chain_unwrap() @test
{
bool b;
if (try v = get_bool() && b)
{
assert(v == true);
}
if (try v = get_bool() && v)
{
assert(v == true);
}
}