From e837df84792d2cbf5c606788c7cab7ea4d1829d0 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Wed, 10 Feb 2021 14:41:54 +0100 Subject: infer: update resolver when descending into block --- crates/hir_ty/src/tests/simple.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'crates/hir_ty/src/tests') diff --git a/crates/hir_ty/src/tests/simple.rs b/crates/hir_ty/src/tests/simple.rs index 16682f76f..ab21332fb 100644 --- a/crates/hir_ty/src/tests/simple.rs +++ b/crates/hir_ty/src/tests/simple.rs @@ -2415,3 +2415,22 @@ fn infer_const_params() { "#]], ); } + +#[test] +fn infer_inner_type() { + check_infer(r#" + fn foo() { + struct S { field: u32 } + let s = S { field: 0 }; + let f = s.field; + } + "#, expect![[r#" + 9..89 '{ ...eld; }': () + 47..48 's': S + 51..65 'S { field: 0 }': S + 62..63 '0': u32 + 75..76 'f': u32 + 79..80 's': S + 79..86 's.field': u32 + "#]]); +} -- cgit v1.2.3