From 8e1a14a098b77b1be8888605f852eada029c816a Mon Sep 17 00:00:00 2001 From: Phil Ellison Date: Sun, 28 Jul 2019 18:41:29 +0100 Subject: Add failing test --- crates/ra_assists/src/add_explicit_type.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'crates/ra_assists/src') 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 { ); } + // https://github.com/rust-analyzer/rust-analyzer/issues/1592 + #[test] + fn add_explicit_type_infers_correct_type_for_floating_point_literal() { + check_assist( + add_explicit_type, + "fn f() { let a<|> = 42f64; }", + "fn f() { let a<|>: f64 = 42f64; }", + ); + } + #[test] fn add_explicit_type_not_applicable_if_ty_not_inferred() { check_assist_not_applicable(add_explicit_type, "fn f() { let a<|> = None; }"); -- cgit v1.2.3