Implement type inference for literals (WIP)

This commit is contained in:
Marcus Klaas de Vries
2019-01-10 13:54:58 +01:00
parent 8caff4e034
commit a6146d35b1
8 changed files with 166 additions and 5 deletions

View File

@@ -132,6 +132,26 @@ fn test(a: &u32, b: &mut u32, c: *const u32, d: *mut u32) {
);
}
#[test]
fn infer_literals() {
check_inference(
r#"
fn test() {
5i32;
"hello";
b"bytes";
'c';
b'b';
3.14;
5000;
(0u32, -5isize);
[true, true, false]
}
"#,
"literals.txt",
);
}
#[test]
fn infer_backwards() {
check_inference(