Skip to content

Commit

Permalink
add tests for expr_optional_cast generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Il-Capitano committed Feb 17, 2024
1 parent 4bb0f48 commit a898fae
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/behavior/success/optional_cast.bz
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import resource;

function test(##value)
{
let _: ?##auto = __forward value;
}

function foo()
{}

function main()
{
test(42u8);
test(42);
test(42i64);

let i = 0;
test(&i);

test(foo);

let func = foo;
test(func);

let i = 0;
test(i);

test(resource_t());
test(complex_resource_t());
}

0 comments on commit a898fae

Please sign in to comment.