v2 / vlib / v / checker / tests / crystallib_struct_init_result_err.vv
21 lines · 18 sloc · 374 bytes · ea3b9ebb31de9f75c1785fe462eeba71bd44bba3
Raw
1struct Path {}
2
3struct Doc {
4mut:
5 content string
6 path Path
7}
8
9fn get_file(path string, create bool) !Path {
10 return Path{}
11}
12
13fn main() {
14 mut doc := Doc{
15 content: 'this is a first line.'
16 path: get_file('config.md', true)
17 }
18 println('First println\n' + doc.content + '\n')
19 doc.content += '\nthis is a second line.'
20 println('Second println\n' + doc.content)
21}
22