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

28 lines
334 B
V

struct Foo<T> {
x int
}
fn (f Foo<T>) pop() {
println('hey')
}
struct Bar<T> {
y int
}
// NB: Bar.foo before Bar.pop, should not cause a V compiler panic
fn (b Bar<T>) foo() bool {
return true
}
fn (b Bar<T>) pop() {
println(b.foo())
}
// fn dummy() { println(Bar<int>{}) }
fn test_foo() {
dump(Foo<int>{})
assert true
}