From: Markus Triska Date: Mon, 29 Nov 2021 18:32:55 +0000 (+0100) Subject: ENHANCED: Correct type error for char_type/2. X-Git-Tag: v0.9.0~14^2 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=79a50de697158a3b2d4087a992c40d23ec8efefb;p=scryer-prolog.git ENHANCED: Correct type error for char_type/2. This addresses #905. --- diff --git a/src/lib/charsio.pl b/src/lib/charsio.pl index 5ff611f6..85856810 100644 --- a/src/lib/charsio.pl +++ b/src/lib/charsio.pl @@ -66,8 +66,7 @@ extend_var_list_([V|Vs], N, VarList, NewVarList, VarType) :- char_type(Char, Type) :- - ( var(Char) -> instantiation_error(char_type/2) - ; atom_length(Char, 1) -> + must_be(character, Char), ( ground(Type) -> ( ctype(Type) -> '$char_type'(Char, Type) @@ -75,9 +74,7 @@ char_type(Char, Type) :- ) ; ctype(Type), '$char_type'(Char, Type) - ) - ; type_error(in_character, Char, char_type/2) - ). + ). ctype(alnum).