mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
llvm issue with try when bool is combined #1467
This commit is contained in:
19
test/unit/regression/unwrapping.c3
Normal file
19
test/unit/regression/unwrapping.c3
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user