Remove warning on generated functions

This commit is contained in:
imaqtkatt 2024-01-26 08:09:08 -03:00
parent dad6c8295a
commit 7751430b15
2 changed files with 4 additions and 5 deletions

View File

@ -33,8 +33,10 @@ impl Book {
if prune {
self.remove_def(unused_id);
} else {
let def_name = self.def_names.id_to_name[&unused_id].clone();
warnings.push(Warning::UnusedDefinition { def_name })
if !self.is_generated_def(unused_id) {
let def_name = self.def_names.id_to_name[&unused_id].clone();
warnings.push(Warning::UnusedDefinition { def_name })
}
}
}
}

View File

@ -13,9 +13,6 @@ input_file: tests/golden_tests/compile_file/match_num_all_patterns.hvm
// WARNING: Unused definition 'zero_succ_var'.
// WARNING: Unused definition 'succ_zero_var'.
// WARNING: Unused definition 'succ_zero_succ'.
// WARNING: Unused definition 'zero_var$S0'.
// WARNING: Unused definition 'zero_var_succ$S0'.
// WARNING: Unused definition 'succ_var_zero$S0'.
@B = (?<(#0 (a a)) b> b)
@D = (<+ #1 <- #1 a>> a)
@E = (<+ #1 <- #1 a>> a)