From 5a1385007cb7509d50a77afa5a47ed0685f7f2f9 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 25 Jan 2019 21:32:49 +0100 Subject: Fix type inference of binops on int/float variables Fixes #651. --- crates/ra_hir/src/ty/tests.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'crates/ra_hir/src/ty/tests.rs') diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 92c74cf00..389bdaf23 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs @@ -532,6 +532,19 @@ fn test() { ); } +#[test] +fn bug_651() { + check_inference( + "bug_651", + r#" +fn quux() { + let y = 92; + 1 + y; +} +"#, + ); +} + fn infer(content: &str) -> String { let (db, _, file_id) = MockDatabase::with_single_file(content); let source_file = db.source_file(file_id); -- cgit v1.2.3