mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-24 06:55:15 +00:00
parent
f2fc6e16ec
commit
59ab1da83f
4 changed files with 78 additions and 19 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