Add test for 2900

Closes #2900
This commit is contained in:
Ayaz Hafiz 2022-04-28 16:12:08 -04:00
parent 9429e50814
commit 3bffdb6037
No known key found for this signature in database
GPG Key ID: 0E2A37416A25EF58

View File

@ -1657,3 +1657,25 @@ fn issue_2777_default_branch_codegen() {
RocList<RocStr>
)
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
#[should_panic(expected = "Erroneous")]
fn issue_2900_unreachable_pattern() {
assert_evals_to!(
indoc!(
r#"
foo : [ Foo, Bar, Baz, Blah ] -> Str
foo = \arg ->
when arg is
Foo -> "foo"
AnUnreachableTag -> "blah"
_ -> "other"
foo Foo
"#
),
RocStr::from("foo"),
RocStr
)
}