From ec4a1dc297eb90dde4c22c682a35606aaa50b4d4 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Thu, 21 Jan 2021 16:23:50 +0100 Subject: Add test that merges inner and outer names --- crates/hir_def/src/nameres/tests/block.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'crates/hir_def/src/nameres') diff --git a/crates/hir_def/src/nameres/tests/block.rs b/crates/hir_def/src/nameres/tests/block.rs index 996704308..ab7ec9d62 100644 --- a/crates/hir_def/src/nameres/tests/block.rs +++ b/crates/hir_def/src/nameres/tests/block.rs @@ -45,3 +45,28 @@ fn outer() { "#]], ); } + +#[test] +fn merge_namespaces() { + check_at( + r#" +//- /lib.rs +struct name {} +fn outer() { + fn name() {} + + use name as imported; // should import both `name`s + + $0 +} +"#, + expect![[r#" + block scope + imported: t v + name: v + crate + name: t + outer: v + "#]], + ); +} -- cgit v1.2.3