Merge pull request #7296 from smores56/proper-try-keyword

Proper `try` keyword
This commit is contained in:
Sam Mohr 2024-12-05 01:38:22 -08:00 committed by GitHub
commit 193c23bac8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 1036 additions and 521 deletions

View file

@ -8,7 +8,7 @@ use roc_module::symbol::{ModuleId, Symbol};
use roc_parse::ast::Base;
use roc_parse::pattern::PatternType;
use roc_region::all::{Loc, Region};
use roc_types::types::AliasKind;
use roc_types::types::{AliasKind, EarlyReturnKind};
use crate::Severity;
@ -244,6 +244,7 @@ pub enum Problem {
},
ReturnOutsideOfFunction {
region: Region,
return_kind: EarlyReturnKind,
},
StatementsAfterReturn {
region: Region,
@ -504,7 +505,7 @@ impl Problem {
| Problem::OverAppliedDbg { region }
| Problem::UnappliedDbg { region }
| Problem::DefsOnlyUsedInRecursion(_, region)
| Problem::ReturnOutsideOfFunction { region }
| Problem::ReturnOutsideOfFunction { region, .. }
| Problem::StatementsAfterReturn { region }
| Problem::ReturnAtEndOfFunction { region }
| Problem::UnsuffixedEffectfulRecordField(region)