diff options
author | Florian Diebold <[email protected]> | 2019-05-05 14:01:07 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-05-11 15:21:20 +0100 |
commit | d8cd0e36f5288dd4c14fb5a07b73533d88f29788 (patch) | |
tree | 818cd580c0ae1ee5e15a122a4c0203d12e35f383 /crates/ra_hir/src/ty/tests.rs | |
parent | 58b68966bf0e0d5ae5c56e2da1d6def5e0ec0925 (diff) |
Handle Chalk conversion for FnDef
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 3c55a093f..f0793bfb4 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -2568,6 +2568,19 @@ fn test() { S2.into()<|>; } | |||
2568 | assert_eq!(t, "S1"); | 2568 | assert_eq!(t, "S1"); |
2569 | } | 2569 | } |
2570 | 2570 | ||
2571 | #[test] | ||
2572 | fn method_resolution_encountering_fn_type() { | ||
2573 | covers!(trait_resolution_on_fn_type); | ||
2574 | type_at( | ||
2575 | r#" | ||
2576 | //- /main.rs | ||
2577 | fn foo() {} | ||
2578 | trait FnOnce { fn call(self); } | ||
2579 | fn test() { foo.call()<|>; } | ||
2580 | "#, | ||
2581 | ); | ||
2582 | } | ||
2583 | |||
2571 | fn type_at_pos(db: &MockDatabase, pos: FilePosition) -> String { | 2584 | fn type_at_pos(db: &MockDatabase, pos: FilePosition) -> String { |
2572 | let file = db.parse(pos.file_id); | 2585 | let file = db.parse(pos.file_id); |
2573 | let expr = algo::find_node_at_offset::<ast::Expr>(file.syntax(), pos.offset).unwrap(); | 2586 | let expr = algo::find_node_at_offset::<ast::Expr>(file.syntax(), pos.offset).unwrap(); |