slige/tests/struct_literal.slg
2025-01-17 11:50:14 +01:00

21 lines
360 B
Plaintext

mod std;
fn main() {
let d = true;
let v = struct {
a: 123,
b: struct {
c: "foo",
d: d,
},
};
std::assert(v.a == 123, "test field");
std::assert(v.b.c == "foo", "test nested field");
std::assert(v.b.d == true, "test resolved field");
std::println("tests ran successfully");
}