mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-21 15:59:20 +03:00
remove panic
This commit is contained in:
parent
f6af66f342
commit
63bc923b37
@ -1532,6 +1532,7 @@ fn make_tag_union_recursive<'a>(
|
||||
let problem = roc_types::types::Problem::CyclicAlias(symbol, region, others.clone());
|
||||
*typ = Type::Erroneous(problem);
|
||||
|
||||
// ensure cyclic error is only reported for one element of the cycle
|
||||
if *can_report_error {
|
||||
*can_report_error = false;
|
||||
|
||||
|
@ -277,9 +277,7 @@ fn to_type(solved_type: &SolvedType, free_vars: &mut FreeVars, var_store: &VarSt
|
||||
|
||||
Type::Alias(*symbol, type_variables, Box::new(actual))
|
||||
}
|
||||
Error => {
|
||||
panic!("TODO convert from SolvedType::Error to Type somehow");
|
||||
}
|
||||
Error => Type::Erroneous(roc_types::types::Problem::SolvedTypeError),
|
||||
Erroneous(problem) => Type::Erroneous(problem.clone()),
|
||||
}
|
||||
}
|
||||
|
@ -831,8 +831,9 @@ fn from_can<'a>(
|
||||
elems: elems.into_bump_slice(),
|
||||
}
|
||||
}
|
||||
Accessor { .. } => todo!("record accessor"),
|
||||
Update { .. } => todo!("record update"),
|
||||
RuntimeError(error) => Expr::RuntimeError(env.arena.alloc(format!("{:?}", error))),
|
||||
other => panic!("TODO convert canonicalized {:?} to mono::Expr", other),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -713,7 +713,7 @@ pub enum Problem {
|
||||
alias_needs: u8,
|
||||
},
|
||||
InvalidModule,
|
||||
// Mismatch(Mismatch, ErrorType, ErrorType),
|
||||
SolvedTypeError,
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Debug, Clone)]
|
||||
|
Loading…
Reference in New Issue
Block a user