From 9429e5081421d079c040253c4a2fcbc42a721f7c Mon Sep 17 00:00:00 2001 From: Ayaz Hafiz Date: Thu, 28 Apr 2022 16:06:51 -0400 Subject: [PATCH] Test for 2778 Closes #2778 --- reporting/tests/test_reporting.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/reporting/tests/test_reporting.rs b/reporting/tests/test_reporting.rs index e99f8b730c..898b319680 100644 --- a/reporting/tests/test_reporting.rs +++ b/reporting/tests/test_reporting.rs @@ -9942,4 +9942,23 @@ I need all branches in an `if` to have the same type! ), ) } + + #[test] + fn issue_2778_specialization_is_not_a_redundant_pattern() { + new_report_problem_as( + "issue_2778_specialization_is_not_a_redundant_pattern", + indoc!( + r#" + formatColor = \color -> + when color is + Red -> "red" + Yellow -> "yellow" + _ -> "unknown" + + Red |> formatColor |> Str.concat (formatColor Orange) + "# + ), + "", // no problem + ) + } }