v/vlib/v/checker/tests/generics_fn_return_generic_...

19 lines
235 B
V

struct GenericChannelStruct<T> {
ch chan T
}
struct Simple {
msg string
}
fn main() {
new_channel_struct<Simple>()
}
pub fn new_channel_struct<T>() GenericChannelStruct {
d := GenericChannelStruct{
ch: chan T{}
}
return d
}