fix: crack crash

This commit is contained in:
Shunsuke Shibayama 2023-10-02 21:50:59 +09:00
parent f1d71e0dab
commit cce95e7210
5 changed files with 55 additions and 20 deletions

View file

@ -1219,7 +1219,8 @@ impl Context {
fn instantiate_tp_as_type(&self, tp: TyParam, loc: &impl Locational) -> TyCheckResult<Type> {
match tp {
TyParam::FreeVar(fv) if fv.is_linked() => {
self.instantiate_tp_as_type(fv.crack().clone(), loc)
let tp = fv.crack().clone();
self.instantiate_tp_as_type(tp, loc)
}
TyParam::Mono(name) => Ok(mono(name)),
TyParam::Proj { obj, attr } => {