From 543d4ef7c536648704848f6df11c4a1ef31e11bc Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Fri, 16 Apr 2021 19:28:22 +0200 Subject: Fix primitive shadowing with inner items --- crates/hir_ty/src/tests/simple.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'crates/hir_ty/src') diff --git a/crates/hir_ty/src/tests/simple.rs b/crates/hir_ty/src/tests/simple.rs index 84c5c05fd..5948d0bc2 100644 --- a/crates/hir_ty/src/tests/simple.rs +++ b/crates/hir_ty/src/tests/simple.rs @@ -1764,6 +1764,24 @@ fn main() { ); } +#[test] +fn shadowing_primitive_with_inner_items() { + check_types( + r#" +struct i32; +struct Foo; + +impl i32 { fn foo(&self) -> Foo { Foo } } + +fn main() { + fn inner() {} + let x: i32 = i32; + x.foo(); + //^ Foo +}"#, + ); +} + #[test] fn not_shadowing_primitive_by_module() { check_types( -- cgit v1.2.3