Add infer tuple test

This commit is contained in:
Hirokazu Hata 2019-01-13 20:51:05 +09:00
parent 0199572a3d
commit 829f668bd7
2 changed files with 17 additions and 0 deletions

View File

@ -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);

View 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