mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
Add note about lack of a guard in missing tag
This commit is contained in:
parent
81481e2599
commit
cc07c93fc3
2 changed files with 5 additions and 2 deletions
|
@ -167,7 +167,8 @@ fn pattern_to_doc_help<'b>(
|
|||
TagName::Global("#Guard".into())
|
||||
);
|
||||
debug_assert!(args.len() == 2);
|
||||
pattern_to_doc_help(alloc, args[1].clone(), in_type_param)
|
||||
let tag = pattern_to_doc_help(alloc, args[1].clone(), in_type_param);
|
||||
tag.append(" (note the lack of a guard)")
|
||||
}
|
||||
RenderAs::Record(field_names) => {
|
||||
let mut arg_docs = Vec::with_capacity(args.len());
|
||||
|
|
|
@ -8486,6 +8486,8 @@ I need all branches in an `if` to have the same type!
|
|||
),
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn non_exhaustive_with_guard() {
|
||||
report_problem_as(
|
||||
indoc!(
|
||||
|
@ -8506,7 +8508,7 @@ I need all branches in an `if` to have the same type!
|
|||
|
||||
Other possibilities include:
|
||||
|
||||
A
|
||||
A (note the lack of a guard)
|
||||
|
||||
I would have to crash if I saw one of those! Add branches for them!
|
||||
"#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue