Gitly
English
Русский
Español
日本語
中文
Português
Pricing
Log in
Register
vxx2
/
vlib
/
v
/
tests
/
interfaces
/
interface_generic_test.v
27
lines
·
23
sloc
·
234 bytes
·
5fcfc27e50f60f81a935f4ee20c30a1bd7298575
Raw
1
interface
IA {
2
a int
3
fa()
4
}
5
6
interface
IB[T] {
7
a int
8
b T
9
fa()
10
}
11
12
struct
Foo[T] implements IA, IB[T] {
13
a int
14
b T
15
}
16
17
fn
(foo Foo[T]) fa() {
18
println(foo.b)
19
}
20
21
fn
test_main() {
22
foo := Foo[u8]{
23
b: 16
24
}
25
foo.fa()
26
assert
true
27
}
28