No subject

Peter Ross pro at missioncriticalit.com
Fri Nov 17 16:13:15 AEDT 2006


The code causes the compiler the abort, note the XXX
which allows the code to compile.

Software Error: map.lookup: key not found
Key Type: term.var(parse_tree.prog_data.prog_var_type)
Key Value: var(6)
Value Type: parse_tree.prog_data.mer_type

:- import_module stream.

:- pred test_stream(S::in, B::di, B::uo, io::di, io::uo) is det
        <= (reader(S, int, B, E), writer(S, int, B)).
            % XXX add these two lines and the program compiles
            % reader(S, float, B, E), writer(S, float, B)).

test_stream(S, !Buffer, !IO) :-
	stream.put(S, 10, !Buffer),
	stream.put(S, 3.14, !Buffer),
	stream.get(S, ResultA : stream.result(int, E), !Buffer),
	stream.get(S, ResultB : stream.result(float, E), !Buffer),
	stream.get(S, ResultC : stream.result(float, E), !Buffer),
	io.write(ResultA, !IO),
	io.nl(!IO),
	io.write(ResultB, !IO),
	io.nl(!IO),
	io.write(ResultC, !IO),
	io.nl(!IO).
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the developers mailing list