v2 / vlib / v / tests / skip_unused / auto_str.vv
20 lines · 15 sloc · 279 bytes · 5dd28cf941cd814da644407dd6441fdc8e592ac0
Raw
1module main
2
3pub struct Tree {}
4
5pub fn (tree &Tree) str() string {
6 return ''
7}
8
9pub struct TreeTwo {
10 Tree
11}
12
13pub fn TreeTwo.from_string(tree_string string) !&TreeTwo {
14 return &TreeTwo{}
15}
16
17fn main() {
18 tree := TreeTwo.from_string('') or { panic(err) }
19 println(tree.str())
20}
21