mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00
Report non-exhaustive patterns with guards
This commit is contained in:
parent
32ef4a5566
commit
81481e2599
4 changed files with 43 additions and 2 deletions
|
@ -160,7 +160,15 @@ fn pattern_to_doc_help<'b>(
|
|||
},
|
||||
Ctor(union, tag_id, args) => {
|
||||
match union.render_as {
|
||||
RenderAs::Guard => panic!("can this happen? inform Folkert"),
|
||||
RenderAs::Guard => {
|
||||
// #Guard <fake-condition-tag> <unexhausted-pattern>
|
||||
debug_assert_eq!(
|
||||
union.alternatives[tag_id.0 as usize].name,
|
||||
TagName::Global("#Guard".into())
|
||||
);
|
||||
debug_assert!(args.len() == 2);
|
||||
pattern_to_doc_help(alloc, args[1].clone(), in_type_param)
|
||||
}
|
||||
RenderAs::Record(field_names) => {
|
||||
let mut arg_docs = Vec::with_capacity(args.len());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue