don't warn about overwriting a clause asserted to a dynamic predicate whose clauses have all been retracted (#870)
This commit is contained in:
@@ -1297,6 +1297,7 @@ fn print_overwrite_warning(
|
|||||||
compilation_target: &CompilationTarget,
|
compilation_target: &CompilationTarget,
|
||||||
code_ptr: IndexPtr,
|
code_ptr: IndexPtr,
|
||||||
key: &PredicateKey,
|
key: &PredicateKey,
|
||||||
|
is_dynamic: bool,
|
||||||
) {
|
) {
|
||||||
if let CompilationTarget::Module(ref module_name) = compilation_target {
|
if let CompilationTarget::Module(ref module_name) = compilation_target {
|
||||||
match module_name.as_str() {
|
match module_name.as_str() {
|
||||||
@@ -1307,6 +1308,7 @@ fn print_overwrite_warning(
|
|||||||
|
|
||||||
match code_ptr {
|
match code_ptr {
|
||||||
IndexPtr::DynamicUndefined | IndexPtr::Undefined => return,
|
IndexPtr::DynamicUndefined | IndexPtr::Undefined => return,
|
||||||
|
_ if is_dynamic => return,
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1460,7 +1462,12 @@ impl<'a> LoadState<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print_overwrite_warning(&predicates.compilation_target, code_index.get(), &key);
|
print_overwrite_warning(
|
||||||
|
&predicates.compilation_target,
|
||||||
|
code_index.get(),
|
||||||
|
&key,
|
||||||
|
settings.is_dynamic(),
|
||||||
|
);
|
||||||
|
|
||||||
set_code_index(
|
set_code_index(
|
||||||
&mut self.retraction_info,
|
&mut self.retraction_info,
|
||||||
|
|||||||
Reference in New Issue
Block a user