v2 / vlib / v / checker / tests / alias_to_option_err.vv
30 lines · 22 sloc · 344 bytes · c657384f72195a6424825c025891bc810757f464
Raw
1type TestInt = ?int
2type TestString = ?string
3type TestF64 = ?f64
4
5struct Struct {
6}
7
8type TestStruct = ?Struct
9
10fn main() {
11 f := TestInt(1)
12 dump(f)
13 println(f)
14
15 g := TestString('foo')
16 dump(g)
17 println(g)
18
19 h := TestString(none)
20 dump(h)
21
22 i := TestF64(none)
23 dump(i)
24
25 l := TestStruct(none)
26 dump(l)
27
28 k := TestStruct(Struct{})
29 dump(k)
30}
31