v / vlib / v2 / gen / arm64 / tests / result_postfix_unwrap.v
28 lines · 24 sloc · 339 bytes · 1e3e9d52d5434ba375aa0e8677279da0ddbaf89c
Raw
1import os
2
3struct Sample {
4 a voidptr
5 b int
6 c bool
7}
8
9fn mk(path string) !Sample {
10 cfile := os.vfopen(path, 'wb')!
11 fd := os.fileno(cfile)
12 return Sample{
13 a: cfile
14 b: fd
15 c: true
16 }
17}
18
19fn main() {
20 s := mk('/tmp/v2_result_postfix_unwrap.txt') or {
21 println('err')
22 return
23 }
24 println(s.b > 0)
25 println(s.c)
26}
27
28// v2-clobber-test
29