mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 02:39:20 +00:00
feat: impl polymorphic type declaration
This commit is contained in:
parent
ea132e2345
commit
5052ebb077
10 changed files with 289 additions and 85 deletions
|
@ -1530,13 +1530,15 @@ impl Context {
|
|||
|
||||
pub(crate) fn instantiate_typespec(&self, t_spec: &ast::TypeSpec) -> TyCheckResult<Type> {
|
||||
let mut dummy_tv_cache = TyVarCache::new(self.level, self);
|
||||
self.instantiate_typespec_full(
|
||||
t_spec,
|
||||
None,
|
||||
&mut dummy_tv_cache,
|
||||
RegistrationMode::Normal,
|
||||
false,
|
||||
)
|
||||
self.instantiate_typespec_with_tv_cache(t_spec, &mut dummy_tv_cache)
|
||||
}
|
||||
|
||||
pub(crate) fn instantiate_typespec_with_tv_cache(
|
||||
&self,
|
||||
t_spec: &ast::TypeSpec,
|
||||
tv_cache: &mut TyVarCache,
|
||||
) -> TyCheckResult<Type> {
|
||||
self.instantiate_typespec_full(t_spec, None, tv_cache, RegistrationMode::Normal, false)
|
||||
}
|
||||
|
||||
pub(crate) fn instantiate_field(&self, ident: &Identifier) -> TyCheckResult<Field> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue