v/vlib/v/tests/generics_method_on_receiver...

18 lines
232 B
V

module main
struct Container<T> {
value T
}
fn (c Container<T>) id() int {
return 1
}
type Text = Container<string>
fn test_generic_method_on_receiver_aliases_type() {
t := Text{'test'}
println(t.id())
assert t.id() == 1
}