]> Repositorios git - scryer-prolog.git/commitdiff
FIXED: instantiation errors for type(Var) in open/4 options
authorMarkus Triska <[email protected]>
Mon, 8 Nov 2021 21:10:14 +0000 (22:10 +0100)
committerMarkus Triska <[email protected]>
Mon, 8 Nov 2021 21:37:46 +0000 (22:37 +0100)
This addresses #1030.

src/lib/builtins.pl

index 3c9c27a18160cb72a3428ffb2930bc3335bb8f32..1a92acf998d1c7a26209c3200a1bc29480e5acad 100644 (file)
@@ -1429,7 +1429,10 @@ parse_stream_options(Options, OptionValues, Stub) :-
 
 
 parse_stream_options_(type(Type), type-Type) :-
-    (  nonvar(Type), lists:member(Type, [text, binary]), !, true
+    (  var(Type) ->
+       throw(error(instantiation_error, open/4)) % 8.1.3 7)
+    ;
+       lists:member(Type, [text, binary]) -> true
     ;
        throw(error(domain_error(stream_option, type(Type)), _))
     ).