Test for 2778

Closes #2778
This commit is contained in:
Ayaz Hafiz 2022-04-28 16:06:51 -04:00
parent 83f9c2a3a0
commit 9429e50814
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -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
)
}
} }