diff options
author | Marcus Klaas de Vries <[email protected]> | 2019-01-10 12:54:58 +0000 |
---|---|---|
committer | Marcus Klaas de Vries <[email protected]> | 2019-01-14 12:52:55 +0000 |
commit | a6146d35b1615cf5fb908b29f34e58bfde3bf96d (patch) | |
tree | 70613ee98eee67c1df6aff1e663be75a33c348f4 /crates/ra_hir/src/ty/tests.rs | |
parent | 8caff4e03475c20392f13e8c6ad469bd01a4b4ce (diff) |
Implement type inference for literals (WIP)
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 920188fc9..97d3d222f 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -133,6 +133,26 @@ fn test(a: &u32, b: &mut u32, c: *const u32, d: *mut u32) { | |||
133 | } | 133 | } |
134 | 134 | ||
135 | #[test] | 135 | #[test] |
136 | fn infer_literals() { | ||
137 | check_inference( | ||
138 | r#" | ||
139 | fn test() { | ||
140 | 5i32; | ||
141 | "hello"; | ||
142 | b"bytes"; | ||
143 | 'c'; | ||
144 | b'b'; | ||
145 | 3.14; | ||
146 | 5000; | ||
147 | (0u32, -5isize); | ||
148 | [true, true, false] | ||
149 | } | ||
150 | "#, | ||
151 | "literals.txt", | ||
152 | ); | ||
153 | } | ||
154 | |||
155 | #[test] | ||
136 | fn infer_backwards() { | 156 | fn infer_backwards() { |
137 | check_inference( | 157 | check_inference( |
138 | r#" | 158 | r#" |