1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/v/parser/tests/generic_struct_parameter_err.vv

24 lines
286 B
V

import datatypes { LinkedList }
struct MyNode[T] {
mut:
data T
}
struct MyContainer[T] {
mut:
lst LinkedList[MyNode[T]]
}
fn (mut c MyContainer[T]) push(data T) {
node := MyNode[T]{
data: data
}
c.lst.push[T](node)
}
fn main() {
mut c := MyContainer[string]{}
println(c)
}