Add infer tuple test
This commit is contained in:
parent
0199572a3d
commit
829f668bd7
@ -268,6 +268,18 @@ fn test(a: A) {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn infer_tuple() {
|
||||
check_inference(
|
||||
r#"
|
||||
fn test() {
|
||||
let a: (u32, &str) = (1, "a");
|
||||
}
|
||||
"#,
|
||||
"tuple.txt",
|
||||
);
|
||||
}
|
||||
|
||||
fn infer(content: &str) -> String {
|
||||
let (db, _, file_id) = MockDatabase::with_single_file(content);
|
||||
let source_file = db.source_file(file_id);
|
||||
|
5
crates/ra_hir/src/ty/tests/data/tuple.txt
Normal file
5
crates/ra_hir/src/ty/tests/data/tuple.txt
Normal file
@ -0,0 +1,5 @@
|
||||
[11; 49) '{ ...a"); }': ()
|
||||
[21; 22) 'a': (u32, &str)
|
||||
[38; 46) '(1, "a")': (u32, &str)
|
||||
[39; 40) '1': u32
|
||||
[42; 45) '"a"': &str
|
Loading…
x
Reference in New Issue
Block a user