Initial working version of proper try keyword

This commit is contained in:
Sam Mohr 2024-12-02 03:20:44 -08:00
parent a7168a4ad6
commit eedade8e81
No known key found for this signature in database
GPG key ID: EA41D161A3C1BC99
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)