From a898fae74962b585d13ad8ca80cdfab5db9e1523 Mon Sep 17 00:00:00 2001 From: Il-Capitano <52455591+Il-Capitano@users.noreply.github.com> Date: Sat, 17 Feb 2024 15:28:33 +0100 Subject: [PATCH] add tests for `expr_optional_cast` generation --- tests/behavior/success/optional_cast.bz | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/behavior/success/optional_cast.bz diff --git a/tests/behavior/success/optional_cast.bz b/tests/behavior/success/optional_cast.bz new file mode 100644 index 00000000..2551737e --- /dev/null +++ b/tests/behavior/success/optional_cast.bz @@ -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()); +}