mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
![]() 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 |
||
---|---|---|
.. | ||
code_gen_help | ||
debug | ||
borrow.rs | ||
debug.rs | ||
decision_tree.rs | ||
expand_rc.rs | ||
inc_dec.rs | ||
ir.rs | ||
layout.rs | ||
layout_soa.rs | ||
lib.rs | ||
low_level.rs | ||
reset_reuse.rs | ||
tail_recursion.rs |