Add SetTypeSpec

This commit is contained in:
Shunsuke Shibayama 2022-10-07 10:59:58 +09:00
parent 3112fb31a9
commit 2cf4b5aba8
6 changed files with 85 additions and 12 deletions

View file

@ -784,6 +784,11 @@ impl Context {
let len = self.instantiate_const_expr(&arr.len);
Ok(array(elem_t, len))
}
TypeSpec::Set(set) => {
let elem_t = self.instantiate_typespec(&set.ty, opt_decl_t, tmp_tv_ctx, mode)?;
let len = self.instantiate_const_expr(&set.len);
Ok(erg_type::constructors::set(elem_t, len))
}
// FIXME: unwrap
TypeSpec::Tuple(tys) => Ok(tuple(
tys.iter()