Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests/simple.rs')
-rw-r--r--crates/hir-ty/src/tests/simple.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/simple.rs b/crates/hir-ty/src/tests/simple.rs
index a525a57743..e2cd7fa26b 100644
--- a/crates/hir-ty/src/tests/simple.rs
+++ b/crates/hir-ty/src/tests/simple.rs
@@ -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
+ }
+}
+"#,
+ );
+}