mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 00:01:16 +00:00
errors for patterns
This commit is contained in:
parent
97c10e1211
commit
c326b09964
5 changed files with 367 additions and 44 deletions
|
@ -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(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue