From a85b32abdc7a9f742e21b1624852eeb04334d4fd Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Wed, 17 Mar 2021 22:30:09 +0100 Subject: Add test for self-calling inner function --- crates/hir_ty/src/tests/traits.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'crates') diff --git a/crates/hir_ty/src/tests/traits.rs b/crates/hir_ty/src/tests/traits.rs index 93d3ad020..8270fa219 100644 --- a/crates/hir_ty/src/tests/traits.rs +++ b/crates/hir_ty/src/tests/traits.rs @@ -3253,3 +3253,24 @@ fn f() { "#, ); } + +#[test] +fn nested_inner_function_calling_self() { + check_infer( + r#" +struct S; +fn f() { + fn inner() -> S { + let s = inner(); + } +} + "#, + expect![[r#" + 17..73 '{ ... } }': () + 39..71 '{ ... }': () + 53..54 's': S + 57..62 'inner': fn inner() -> S + 57..64 'inner()': S + "#]], + ) +} -- cgit v1.2.3