Files
mercury/tests/invalid/any_mode.m
Fergus Henderson 57af1d1b8d Fix a bug where the compiler reported an internal error `unify_inst failed'
Estimated hours taken: 6

Fix a bug where the compiler reported an internal error `unify_inst failed'
for certain ill-moded calls involving `any' insts.

compiler/inst_util.m:
	Add code in abstractly_unify_inst to handle some more cases
	of `any' that previously we didn't allow; specifically, the case
	of unifying a `bound' or `ground' inst with `any'.
	The new cases are allowed only in the `fake_unify' case, not in
	the `real_unify' case, because code generation doesn't yet
	support these cases.

	Also fix a couple of unrelated bugs in abstractly_unify_inst
	where the `live' case was passing `dead' rather than `live'
	to unify_uniq.

compiler/prog_data.m:
	Add a new compiler-generated inst name `any_inst', similar to
	`ground_inst', but for insts resulting from unification with
	`any' rather than unification with `ground'.

compiler/hlds_data.m:
	Any a new `any_inst' table, similar to the `ground_inst' table.

compiler/mercury_to_mercury.m:
compiler/mode_util.m:
	Minor changes to handle new `any_inst' insts.

compiler/inst_util.m:
	Fix a couple of bugs

tests/invalid/Mmake:
tests/invalid/any_mode.m:
tests/invalid/any_mode.err_exp:
	Regression test for the above change.
1997-09-14 09:12:40 +00:00

10 lines
99 B
Mathematica

:- module any_mode.
:- interface.
:- mode p(any -> ground).
p(X) :- q(X).
:- mode q(in).
q(42).