Open edwardpeters opened 7 months ago
Describe the bug Morphir elm will compile code with incomplete pattern matching. This can result in runtime errors.
To Reproduce The following code compiles:
type MyUnion = A | B foo : MyUnion -> String foo x = case x of A -> "A" bar : Int -> String bar i = foo B
When bar is run, it results in "Unable to compute", as makes sense given that the pattern match does not handle that case.
bar
Expected behavior Type checking should enforce that pattern matching is exhaustive.
Desktop (please complete the following information):
Describe the bug Morphir elm will compile code with incomplete pattern matching. This can result in runtime errors.
To Reproduce The following code compiles:
When
bar
is run, it results in "Unable to compute", as makes sense given that the pattern match does not handle that case.Expected behavior Type checking should enforce that pattern matching is exhaustive.
Desktop (please complete the following information):