mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
remove panic
This commit is contained in:
parent
f6af66f342
commit
63bc923b37
4 changed files with 5 additions and 5 deletions
|
@ -1532,6 +1532,7 @@ fn make_tag_union_recursive<'a>(
|
||||||
let problem = roc_types::types::Problem::CyclicAlias(symbol, region, others.clone());
|
let problem = roc_types::types::Problem::CyclicAlias(symbol, region, others.clone());
|
||||||
*typ = Type::Erroneous(problem);
|
*typ = Type::Erroneous(problem);
|
||||||
|
|
||||||
|
// ensure cyclic error is only reported for one element of the cycle
|
||||||
if *can_report_error {
|
if *can_report_error {
|
||||||
*can_report_error = false;
|
*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))
|
Type::Alias(*symbol, type_variables, Box::new(actual))
|
||||||
}
|
}
|
||||||
Error => {
|
Error => Type::Erroneous(roc_types::types::Problem::SolvedTypeError),
|
||||||
panic!("TODO convert from SolvedType::Error to Type somehow");
|
|
||||||
}
|
|
||||||
Erroneous(problem) => Type::Erroneous(problem.clone()),
|
Erroneous(problem) => Type::Erroneous(problem.clone()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -831,8 +831,9 @@ fn from_can<'a>(
|
||||||
elems: elems.into_bump_slice(),
|
elems: elems.into_bump_slice(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Accessor { .. } => todo!("record accessor"),
|
||||||
|
Update { .. } => todo!("record update"),
|
||||||
RuntimeError(error) => Expr::RuntimeError(env.arena.alloc(format!("{:?}", error))),
|
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,
|
alias_needs: u8,
|
||||||
},
|
},
|
||||||
InvalidModule,
|
InvalidModule,
|
||||||
// Mismatch(Mismatch, ErrorType, ErrorType),
|
SolvedTypeError,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Debug, Clone)]
|
#[derive(PartialEq, Eq, Debug, Clone)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue