forked from M-Labs/nac3
nac3core: remove unnecessary inline and function parameters
This commit is contained in:
parent
22a728833d
commit
236989defc
|
@ -491,8 +491,7 @@ impl TopLevelComposer {
|
|||
// push self to the ancestors
|
||||
class_ancestors.push(make_self_type_annotation(
|
||||
&temp_def_list,
|
||||
class_id,
|
||||
self.unifier.borrow_mut(),
|
||||
class_id
|
||||
)?)
|
||||
}
|
||||
Ok(())
|
||||
|
@ -867,7 +866,7 @@ impl TopLevelComposer {
|
|||
};
|
||||
type_var_to_concrete_def.insert(
|
||||
dummy_func_arg.ty,
|
||||
make_self_type_annotation(temp_def_list, *class_id, unifier)?,
|
||||
make_self_type_annotation(temp_def_list, *class_id)?,
|
||||
);
|
||||
result.push(dummy_func_arg);
|
||||
}
|
||||
|
@ -926,7 +925,7 @@ impl TopLevelComposer {
|
|||
let dummy_return_type = unifier.get_fresh_var().0;
|
||||
type_var_to_concrete_def.insert(
|
||||
dummy_return_type,
|
||||
make_self_type_annotation(temp_def_list, *class_id, unifier)?,
|
||||
make_self_type_annotation(temp_def_list, *class_id)?,
|
||||
);
|
||||
dummy_return_type
|
||||
}
|
||||
|
|
|
@ -222,7 +222,6 @@ pub fn get_type_from_type_annotation_kinds(
|
|||
/// the first return is the duplicated type \
|
||||
/// the second return is the var_id of the duplicated type \
|
||||
/// the third return is the var_id of the original type
|
||||
#[inline]
|
||||
pub fn duplicate_type_var(unifier: &mut Unifier, type_var: Type) -> (Type, u32, u32) {
|
||||
let ty = unifier.get_ty(type_var);
|
||||
if let TypeEnum::TVar { id, range, .. } = ty.as_ref() {
|
||||
|
@ -255,8 +254,7 @@ pub fn duplicate_type_var(unifier: &mut Unifier, type_var: Type) -> (Type, u32,
|
|||
/// and unify them with the class generic `T`, `V`
|
||||
pub fn make_self_type_annotation(
|
||||
top_level_defs: &[Arc<RwLock<TopLevelDef>>],
|
||||
def_id: DefinitionId,
|
||||
_unifier: &mut Unifier,
|
||||
def_id: DefinitionId
|
||||
) -> Result<TypeAnnotation, String> {
|
||||
let obj_def =
|
||||
top_level_defs.get(def_id.0).ok_or_else(|| "invalid definition id".to_string())?;
|
||||
|
|
Loading…
Reference in New Issue