diff options
author | Florian Diebold <[email protected]> | 2019-01-25 20:32:49 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-01-25 20:32:49 +0000 |
commit | 5a1385007cb7509d50a77afa5a47ed0685f7f2f9 (patch) | |
tree | c996152aa889c1ef7c6af18ae88f328a2ba2c5fb /crates/ra_hir/src/ty/tests.rs | |
parent | 03fc615ead78ecf126632220104fa4de3414eb7f (diff) |
Fix type inference of binops on int/float variables
Fixes #651.
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 13 |
1 files changed, 13 insertions, 0 deletions
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() { | |||
532 | ); | 532 | ); |
533 | } | 533 | } |
534 | 534 | ||
535 | #[test] | ||
536 | fn bug_651() { | ||
537 | check_inference( | ||
538 | "bug_651", | ||
539 | r#" | ||
540 | fn quux() { | ||
541 | let y = 92; | ||
542 | 1 + y; | ||
543 | } | ||
544 | "#, | ||
545 | ); | ||
546 | } | ||
547 | |||
535 | fn infer(content: &str) -> String { | 548 | fn infer(content: &str) -> String { |
536 | let (db, _, file_id) = MockDatabase::with_single_file(content); | 549 | let (db, _, file_id) = MockDatabase::with_single_file(content); |
537 | let source_file = db.source_file(file_id); | 550 | let source_file = db.source_file(file_id); |