feat: add exception module

This commit is contained in:
Shunsuke Shibayama 2024-01-04 21:41:24 +09:00
parent 8548ea89fe
commit 951c85a344
9 changed files with 105 additions and 4 deletions

View file

@ -17,7 +17,7 @@ use erg_parser::ast::{
use erg_parser::token::TokenKind;
use erg_parser::Parser;
use crate::ty::free::{CanbeFree, Constraint};
use crate::ty::free::{CanbeFree, Constraint, HasLevel};
use crate::ty::typaram::{IntervalOp, OpKind, TyParam, TyParamLambda, TyParamOrdering};
use crate::ty::value::ValueObj;
use crate::ty::{constructors::*, Predicate, RefinementType, VisibilityModifier};
@ -1798,7 +1798,16 @@ impl Context {
t_spec: &ast::TypeSpec,
tv_cache: &mut TyVarCache,
) -> TyCheckResult<Type> {
self.instantiate_typespec_full(t_spec, None, tv_cache, RegistrationMode::Normal, false)
let t = self.instantiate_typespec_full(
t_spec,
None,
tv_cache,
RegistrationMode::Normal,
false,
)?;
t.lift();
let t = self.generalize_t(t);
Ok(t)
}
pub(crate) fn instantiate_field(&self, ident: &Identifier) -> TyCheckResult<Field> {