Skip to content

Commit 1d782a9

Browse files
committed
Add test for private method inference fallback
1 parent 5d54c55 commit 1d782a9

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

crates/hir-ty/src/tests/method_resolution.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,3 +1896,24 @@ impl dyn Error + Send {
18961896
"#,
18971897
);
18981898
}
1899+
1900+
#[test]
1901+
fn fallback_private_methods() {
1902+
check(
1903+
r#"
1904+
mod module {
1905+
pub struct Struct;
1906+
1907+
impl Struct {
1908+
fn func(&self) {}
1909+
}
1910+
}
1911+
1912+
fn foo() {
1913+
let s = module::Struct;
1914+
s.func();
1915+
//^^^^^^^^ type: ()
1916+
}
1917+
"#,
1918+
);
1919+
}

0 commit comments

Comments
 (0)