Files
mercury/tests/valid/modes_bug.m
Fergus Henderson 84e177f4b7 Add a new regression test modes_bug.m, for a bug in inst_match.m
Estimated hours taken: 0.25

tests/valid:
	Add a new regression test modes_bug.m, for a bug in inst_match.m
	that I recently fixed.
1996-11-24 13:10:05 +00:00

28 lines
674 B
Mathematica

/*
Regression test.
$ mc modes_bug.m
In clause for `'__Unify__'((bound(foo(unique(42))) -> bound(foo(unique(42)))), (bound(foo(unique(42))) -> bound(foo(unique(42)))))':
mode error: argument 1 did not get sufficiently instantiated.
Final instantiatedness of `V_1' was `bound(foo(bound(42)))',
expected final instantiatedness was `bound(foo(unique(42)))'.
Software error: mode error in compiler-generated unification predicate
*/
:- module modes_bug.
:- interface.
:- type foo ---> foo(int).
:- type bar ---> bar(foo) ; baz.
:- pred test(bar::out) is det.
:- implementation.
test(Y) :-
Y = bar(_),
Z = 42,
Y2 = foo(Z),
Y = bar(Y2),
Y2 = foo(_),
Y = bar(Y2).