Fallback to method resolution on unresolved field access with matching method name

This commit is contained in:
Lukas Wirth 2023-12-08 16:36:41 +01:00
parent 9c3de09f6d
commit 35fbc0210c
5 changed files with 140 additions and 72 deletions

View file

@ -6698,3 +6698,30 @@ foo!(r"{$0aaaaa}");
"#]],
);
}
#[test]
fn method_call_without_parens() {
check(
r#"
struct S;
impl S {
fn foo<T>(&self, t: T) {}
}
fn main() {
S.foo$0;
}
"#,
expect![[r#"
*foo*
```rust
test::S
```
```rust
fn foo<T>(&self, t: T)
```
"#]],
);
}