diff options
-rw-r--r-- | crates/ra_assists/src/add_explicit_type.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/ra_assists/src/add_explicit_type.rs b/crates/ra_assists/src/add_explicit_type.rs index 88970929f..7c6080640 100644 --- a/crates/ra_assists/src/add_explicit_type.rs +++ b/crates/ra_assists/src/add_explicit_type.rs | |||
@@ -69,6 +69,16 @@ mod tests { | |||
69 | ); | 69 | ); |
70 | } | 70 | } |
71 | 71 | ||
72 | // https://github.com/rust-analyzer/rust-analyzer/issues/1592 | ||
73 | #[test] | ||
74 | fn add_explicit_type_infers_correct_type_for_floating_point_literal() { | ||
75 | check_assist( | ||
76 | add_explicit_type, | ||
77 | "fn f() { let a<|> = 42f64; }", | ||
78 | "fn f() { let a<|>: f64 = 42f64; }", | ||
79 | ); | ||
80 | } | ||
81 | |||
72 | #[test] | 82 | #[test] |
73 | fn add_explicit_type_not_applicable_if_ty_not_inferred() { | 83 | fn add_explicit_type_not_applicable_if_ty_not_inferred() { |
74 | check_assist_not_applicable(add_explicit_type, "fn f() { let a<|> = None; }"); | 84 | check_assist_not_applicable(add_explicit_type, "fn f() { let a<|> = None; }"); |