diff options
author | Jonas Schievink <[email protected]> | 2021-02-10 13:41:54 +0000 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-02-10 13:41:54 +0000 |
commit | e837df84792d2cbf5c606788c7cab7ea4d1829d0 (patch) | |
tree | 7b9b4e4523803432d157220199a4a11c4821c471 /crates/hir_ty/src/tests | |
parent | 82a1b91f205ac9c3d397b2bea033639f5df9e6b6 (diff) |
infer: update resolver when descending into block
Diffstat (limited to 'crates/hir_ty/src/tests')
-rw-r--r-- | crates/hir_ty/src/tests/simple.rs | 19 |
1 files changed, 19 insertions, 0 deletions
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() { | |||
2415 | "#]], | 2415 | "#]], |
2416 | ); | 2416 | ); |
2417 | } | 2417 | } |
2418 | |||
2419 | #[test] | ||
2420 | fn infer_inner_type() { | ||
2421 | check_infer(r#" | ||
2422 | fn foo() { | ||
2423 | struct S { field: u32 } | ||
2424 | let s = S { field: 0 }; | ||
2425 | let f = s.field; | ||
2426 | } | ||
2427 | "#, expect![[r#" | ||
2428 | 9..89 '{ ...eld; }': () | ||
2429 | 47..48 's': S | ||
2430 | 51..65 'S { field: 0 }': S | ||
2431 | 62..63 '0': u32 | ||
2432 | 75..76 'f': u32 | ||
2433 | 79..80 's': S | ||
2434 | 79..86 's.field': u32 | ||
2435 | "#]]); | ||
2436 | } | ||