Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Jan 6, 2025
1 parent 499e7ac commit 14fecb1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions vlib/v/tests/options/option_generic_alias_test.v
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 14fecb1

Please sign in to comment.