Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
skip_unused
/
aggregate_call.vv
20
lines
·
15
sloc
·
180 bytes
·
983511f21de4d060f345724ab9cc1c6378aa9c80
Raw
1
struct Foo {}
2
3
struct Bar {}
4
5
type SumType = Foo | Bar
6
7
fn (f Foo) pstr() {
8
}
9
10
fn (b Bar) pstr() {
11
}
12
13
fn main() {
14
a := SumType(Foo{})
15
match a {
16
Foo, Bar {
17
a.pstr()
18
}
19
}
20
}
21