nac3core: fix broken top level test due to hashmap order

escape-analysis
ychenfo 2021-09-09 00:44:56 +08:00
parent 5a1a8ecee3
commit 2ce507964c
3 changed files with 10 additions and 6 deletions

View File

@ -43,7 +43,12 @@ impl TopLevelDef {
"Function {{\nname: {:?},\nsig: {:?},\nvar_id: {:?}\n}}",
name,
unifier.stringify(*signature, obj_to_name, var_to_name),
var_id
{
// NOTE: preserve the order for debug output and test
let mut r = var_id.clone();
r.sort_unstable();
r
}
),
TopLevelDef::Initializer { class_id } => format!("Initializer {{ {:?} }}", class_id),
}

View File

@ -864,8 +864,7 @@ impl TopLevelComposer {
)?
};
// find type vars within this method parameter type annotation
let type_vars_within =
get_type_var_contained_in_type_annotation(&type_ann);
let type_vars_within = get_type_var_contained_in_type_annotation(&type_ann);
// handle the class type var and the method type var
for type_var_within in type_vars_within {
if let TypeAnnotation::TypeVarKind(ty) = type_var_within {