]> Repositorios git - scryer-prolog.git/commitdiff
third argument of copy_term should be instantiated as a list (#1747)
authorMark Thom <[email protected]>
Sun, 26 Feb 2023 23:29:39 +0000 (16:29 -0700)
committerMark Thom <[email protected]>
Mon, 27 Feb 2023 05:42:02 +0000 (22:42 -0700)
src/machine/project_attributes.pl

index 59ad07904efa9262a33de05cb221a07e65d706f7..20a19e975d8b112e643a83016f4f9eb911e9151b 100644 (file)
@@ -111,7 +111,11 @@ delete_all_attributes_from_var(V) :- '$delete_all_attributes_from_var'(V).
 
 copy_term(Term, Copy, Gs) :-
    can_be(list, Gs),
-   findall(Term-Rs, term_residual_goals(Term,Rs), [Copy-Gs]).
+   findall(Term-Rs, term_residual_goals(Term,Rs), [Copy-Gs]),
+   (  var(Gs) ->
+      Gs = []
+   ;  true
+   ).
 
 term_residual_goals(Term,Rs) :-
     '$term_attributed_variables'(Term, Vs),