mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-23 14:35:12 +00:00
Merge pull request #3616 from rtfeldman/i3614
Compile branches in the presence of degenerate patterns
This commit is contained in:
commit
d212dffa1a
14 changed files with 210 additions and 66 deletions
|
@ -329,6 +329,24 @@ pub enum RuntimeError {
|
|||
EmptySingleQuote(Region),
|
||||
/// where 'aa'
|
||||
MultipleCharsInSingleQuote(Region),
|
||||
|
||||
DegenerateBranch(Region),
|
||||
}
|
||||
|
||||
impl RuntimeError {
|
||||
pub fn runtime_message(self) -> String {
|
||||
use RuntimeError::*;
|
||||
|
||||
match self {
|
||||
DegenerateBranch(region) => {
|
||||
format!(
|
||||
"Hit a branch pattern that does not bind all symbols its body needs, at {:?}",
|
||||
region
|
||||
)
|
||||
}
|
||||
err => format!("{:?}", err),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue