remove panic

This commit is contained in:
Folkert 2020-04-13 22:35:34 +02:00
parent f6af66f342
commit 63bc923b37
4 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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()),
}
}

View File

@ -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),
}
}

View File

@ -713,7 +713,7 @@ pub enum Problem {
alias_needs: u8,
},
InvalidModule,
// Mismatch(Mismatch, ErrorType, ErrorType),
SolvedTypeError,
}
#[derive(PartialEq, Eq, Debug, Clone)]