Add test for private method inference fallback

This commit is contained in:
Lukas Wirth 2022-12-31 11:42:44 +01:00
parent 5d54c550e7
commit 1d782a9095

View File

@ -1896,3 +1896,24 @@ impl dyn Error + Send {
"#,
);
}
#[test]
fn fallback_private_methods() {
check(
r#"
mod module {
pub struct Struct;
impl Struct {
fn func(&self) {}
}
}
fn foo() {
let s = module::Struct;
s.func();
//^^^^^^^^ type: ()
}
"#,
);
}