mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 18:58:30 +00:00
fix: refinement type assert cast bug
This commit is contained in:
parent
17625884b9
commit
e236a65c21
7 changed files with 72 additions and 8 deletions
|
@ -141,6 +141,14 @@ impl<T> Triple<T, T> {
|
|||
Triple::Ok(a) | Triple::Err(a) => Some(a),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn merge_or(self, default: T) -> T {
|
||||
match self {
|
||||
Triple::None => default,
|
||||
Triple::Ok(ok) => ok,
|
||||
Triple::Err(err) => err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, E: std::error::Error> Triple<T, E> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue