We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 190a059 commit 7d0586cCopy full SHA for 7d0586c
crates/ra_hir_ty/src/infer/coerce.rs
@@ -45,9 +45,7 @@ impl<'a> InferenceContext<'a> {
45
self.coerce_merge_branch(&ptr_ty1, &ptr_ty2)
46
} else {
47
mark::hit!(coerce_merge_fail_fallback);
48
- // For incompatible types, we use the latter one as result
49
- // to be better recovery for `if` without `else`.
50
- ty2.clone()
+ ty1.clone()
51
}
52
53
crates/ra_hir_ty/src/tests/simple.rs
@@ -937,7 +937,7 @@ fn main(foo: Foo) {
937
51..107 'if tru... }': ()
938
54..58 'true': bool
939
59..67 '{ }': ()
940
- 73..107 'if fal... }': ()
+ 73..107 'if fal... }': i32
941
76..81 'false': bool
942
82..107 '{ ... }': i32
943
92..95 'foo': Foo
0 commit comments