mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-22 00:09:33 +03:00
759127660d
When compiling a pattern match like ``` [] -> .. [_] -> .. [_, ..] -> .. ``` to a decision tree, we must make sure that the last test (len >= 1) does not touch the branch reached by the second test (len == 1). It is enough to ban (len >=) tests from ever touching exact-sized list patterns, because a spread test (len >=) can never reach an exact-sized test. On the other hand, an exact-sized test can reach a spread pattern, because in ``` [_, _] -> .. [..] -> .. ``` the last branch generates tests for patterns `[]` and `[_]`, and we would like those patterns to be covered by the spread test (len >= 0)! Closes #4685 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |