1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
Files
v/vlib/v/tests/struct_child_field_default_test.v

23 lines
305 B
V

struct Position {
line_nr int = 1
}
struct Statement {
pos Position
}
struct Expression {
pos Position
}
fn test_child_struct_field_default() {
stmt := Statement{
pos: Position{}
}
expr := Expression{}
println(stmt)
println(expr)
assert stmt.pos.line_nr == 1
assert expr.pos.line_nr == 1
}