mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
chore: remove __new__
This commit is contained in:
parent
ca140680db
commit
f8b7717682
10 changed files with 131 additions and 43 deletions
|
@ -20,6 +20,18 @@ pub use crate::error::tycheck::*;
|
|||
use crate::hir::Expr;
|
||||
use crate::ty::HasType;
|
||||
|
||||
pub(crate) fn concat_result(l: CompileResult<()>, r: CompileResult<()>) -> CompileResult<()> {
|
||||
match (l, r) {
|
||||
(Ok(()), Ok(())) => Ok(()),
|
||||
(Ok(()), Err(r)) => Err(r),
|
||||
(Err(l), Ok(())) => Err(l),
|
||||
(Err(mut l), Err(mut r)) => {
|
||||
l.0.append(&mut r.0);
|
||||
Err(l)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// `unreachable!(self: Context)`
|
||||
#[macro_export]
|
||||
macro_rules! unreachable_error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue