| 1 | struct Position { |
| 2 | line_nr int = 1 |
| 3 | } |
| 4 | |
| 5 | struct Statement { |
| 6 | pos Position |
| 7 | } |
| 8 | |
| 9 | struct Expression { |
| 10 | pos Position |
| 11 | } |
| 12 | |
| 13 | fn test_child_struct_field_default() { |
| 14 | stmt := Statement{ |
| 15 | pos: Position{} |
| 16 | } |
| 17 | expr := Expression{} |
| 18 | println(stmt) |
| 19 | println(expr) |
| 20 | assert stmt.pos.line_nr == 1 |
| 21 | assert expr.pos.line_nr == 1 |
| 22 | } |
| 23 |