v2 / vlib / v / tests / skip_unused / aggregate_call.vv
20 lines · 15 sloc · 180 bytes · 983511f21de4d060f345724ab9cc1c6378aa9c80
Raw
1struct Foo {}
2
3struct Bar {}
4
5type SumType = Foo | Bar
6
7fn (f Foo) pstr() {
8}
9
10fn (b Bar) pstr() {
11}
12
13fn main() {
14 a := SumType(Foo{})
15 match a {
16 Foo, Bar {
17 a.pstr()
18 }
19 }
20}
21