mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
16 lines
185 B
V
16 lines
185 B
V
struct Blah {
|
|
mut:
|
|
arr []string
|
|
}
|
|
|
|
fn test<T>() T {
|
|
return T{}
|
|
}
|
|
|
|
fn test_generics_struct_init() {
|
|
mut b := test<Blah>()
|
|
b.arr << 'item'
|
|
println(b.arr)
|
|
assert b.arr == ['item']
|
|
}
|