Skip to content

Commit f410fdf

Browse files
committed
Add two more tests
1 parent 29f01cd commit f410fdf

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

crates/ide/src/goto_definition.rs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,6 +1429,43 @@ fn f() {
14291429
"#,
14301430
);
14311431
}
1432+
1433+
#[test]
1434+
fn method_call_defaulted() {
1435+
check(
1436+
r#"
1437+
trait Twait {
1438+
fn a(&self) {}
1439+
//^
1440+
}
1441+
1442+
struct Stwuct;
1443+
1444+
impl Twait for Stwuct {
1445+
}
1446+
fn f() {
1447+
let s = Stwuct;
1448+
s.a$0();
1449+
}
1450+
"#,
1451+
);
1452+
}
1453+
1454+
#[test]
1455+
fn method_call_on_generic() {
1456+
check(
1457+
r#"
1458+
trait Twait {
1459+
fn a(&self) {}
1460+
//^
1461+
}
1462+
1463+
fn f<T: Twait>(s: T) {
1464+
s.a$0();
1465+
}
1466+
"#,
1467+
);
1468+
}
14321469
}
14331470

14341471
#[test]

0 commit comments

Comments
 (0)