Files
mercury/tests/valid/tricky_ite.m
Fergus Henderson 7dd69ebfb6 Fix a bug where the code generator complained about `nondet
Estimated hours taken: 2

compiler/simplify.m:
	Fix a bug where the code generator complained about `nondet
	model in semidet context':  If a model_det or model_semi
	if-then-else has a model_nondet condition, then change the
	determinism of the if-then-else as a whole to nondet and put it
	inside a `some'.  (This can only happen if the `then' part
	has determinism `erroneous' or `failure'.)  The treatment
	of this problem for if-then-elses is similar to the way we
	treat the analgous problem for conjunctions.

tests/valid/Mmake:
tests/valid/tricky_ite.m:
	Regression test for the above bug fix.
1997-08-09 01:30:37 +00:00

22 lines
327 B
Mathematica

:- module tricky_ite.
:- interface.
:- import_module io.
:- pred main(io__state::di, io__state::uo) is det.
:- implementation.
:- import_module int, require.
main -->
( { p(42, X) } ->
{ error("blah") },
write(X)
;
io__write_string("No.\n")
).
:- pred p(int::in, int::out) is nondet.
p(42, 1).
p(42, 2).
p(42, 3).