Files
mercury/tests/valid/intermod_user_equality_nested2.m
Fergus Henderson 35134eedb2 Fix a bug in these test cases that caused a compile error
Estimated hours taken: 1

tests/valid/intermod_user_equality2.m:
tests/valid/intermod_user_equality_nested2.m:
	Fix a bug in these test cases that caused a compile error
	("unification for non-canonical type is not guaranteed to succeed")
	when building things in MLDS grades.  For the LLDS back-end,
	these modules weren't being compiled, only the modules that
	import them were being compiled; but for the MLDS back-end,
	compiling the latter to `.o' requires generating the header
	files for the former, and generating the header files requires
	compilation.
2000-05-16 19:49:47 +00:00

40 lines
651 B
Mathematica

:- module intermod_user_equality_nested2.
:- interface.
:- type foo.
:- typeclass class(T) where [
pred p(T::in, T::in) is semidet
].
:- instance class(foo).
:- pred foo_field1(foo::in, int::out) is cc_nondet.
:- module intermod_user_equality_nested2__sub.
:- interface.
:- type bar
---> bar(foo).
:- end_module intermod_user_equality_nested2__sub.
:- implementation.
:- type foo
---> ctor1(int, int)
; ctor2(int, int)
where equality is foo_unify.
:- instance class(foo) where [
pred(p/2) is foo_unify
].
:- pred foo_unify(foo::in, foo::in) is semidet.
foo_unify(X, X).
foo_field1(ctor1(X, _), X).
foo_field1(ctor2(X, _), X).