errors for patterns

This commit is contained in:
Folkert 2020-04-12 16:39:54 +02:00
parent 97c10e1211
commit c326b09964
5 changed files with 367 additions and 44 deletions

View file

@ -146,9 +146,10 @@ pub enum Guard {
pub fn check<'a>(
region: Region,
patterns: &[(Located<crate::expr::Pattern<'a>>, Guard)],
context: Context,
) -> Result<(), Vec<Error>> {
let mut errors = Vec::new();
check_patterns(region, Context::BadArg, patterns, &mut errors);
check_patterns(region, context, patterns, &mut errors);
if errors.is_empty() {
Ok(())