From 14fecb1313166f3e572d78843e877ff64dd2d9af Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Mon, 6 Jan 2025 16:19:29 -0300 Subject: [PATCH] test --- .../v/tests/options/option_generic_alias_test.v | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 vlib/v/tests/options/option_generic_alias_test.v diff --git a/vlib/v/tests/options/option_generic_alias_test.v b/vlib/v/tests/options/option_generic_alias_test.v new file mode 100644 index 00000000000000..a4c3880148edf0 --- /dev/null +++ b/vlib/v/tests/options/option_generic_alias_test.v @@ -0,0 +1,17 @@ +type I64 = i64 + +fn test[T](a ?T) ?T { + w := ?T(a) + return w +} + +fn test_main() { + a := ?i64(123) + b := test[I64](a) + println(b) + assert b != none + assert b? == 123 + c := test[I64](none) + println(c) + assert c == none +}