feat: Implement default-field-values

This commit is contained in:
Shoyu Vanilla 2025-01-23 00:27:31 +09:00
parent 35b55fd67f
commit 7de0b2e75a
33 changed files with 647 additions and 31 deletions

View file

@ -1232,6 +1232,21 @@ fn f() {
let (_, _, _, ..) = (true, 42);
// ^^^^^^^^^^^^^ error: expected (bool, i32), found (bool, i32, {unknown})
}
"#,
);
}
#[test]
fn diagnostics_inside_field_default_expr() {
check_diagnostics(
r#"
struct Foo {
foo: i32 = {
let x = false;
x
// ^ error: expected i32, found bool
},
}
"#,
);
}