]> Repositorios git - scryer-prolog.git/commitdiff
Fix char_code/2 predicate wrong error term when the first argument is bound but is...
authorPaulo Moura <>
Mon, 10 May 2021 20:27:04 +0000 (21:27 +0100)
committerPaulo Moura <>
Mon, 10 May 2021 20:27:04 +0000 (21:27 +0100)
src/lib/builtins.pl

index 9643d899faf8e523e1992ba53da8dc52bbb960ec..ff08ca9d58761a0becebd169ddddda20445260e2 100644 (file)
@@ -1296,6 +1296,8 @@ char_code(Char, Code) :-
           '$char_code'(Char, Code)
        ;  throw(error(type_error(integer, Code), char_code/2))
        )
+    ;  \+ atom(Char) ->
+       throw(error(type_error(character, Char), char_code/2))
     ;  atom_length(Char, 1) ->
        (  var(Code) ->
           '$char_code'(Char, Code)