fix: Fix expression scopes not being calculated for inline consts

This commit is contained in:
Lukas Wirth 2024-04-25 09:49:19 +02:00
parent ec941e599a
commit ac389ce2ef
7 changed files with 69 additions and 34 deletions

View file

@ -3664,3 +3664,21 @@ fn main() {
"#,
);
}
#[test]
fn inline_const_expression() {
check(
r#"
fn main() {
let foo = 0;
const {
let bar = 1;
let unresolved = foo;
// ^^^^^^^^^^ type: {unknown}
let resolved = bar;
// ^^^^^^^^ type: i32
}
}
"#,
);
}