Files
mercury/tests/general/det_complicated_unify.m
Zoltan Somogyi ecb5e4a9e6 Update the style of many test cases.
tests/declarative_debugger/*.m:
tests/exceptions/*.m:
tests/general/*.m:
tests/grade_subdirs/*.m:
tests/purity/*.m:
tests/submodules/*.m:
tests/typeclasses/*.m:
    Update programming style.

tests/declarative_debugger/*.inp:
    Update line numbers in breakpoint commands.
tests/declarative_debugger/*.exp:
    Update expected line numbers.

tests/exceptions/Mercury.options:
tests/general/Mercury.options:
    Disable some warnings that are irrelevant to the test.
2021-07-25 23:26:17 +10:00

34 lines
811 B
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
%
% This tests that the compiler handles deterministic complicated
% unifications on enums and compound types correctly.
% (Version 0.4 of the compiler failed this test.)
:- module det_complicated_unify.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
:- implementation.
:- type foo
---> foo(bar).
:- type bar
---> bar.
main(!IO) :-
p(foo(bar), foo(bar)), q(bar, bar),
io.write_string("worked\n", !IO).
:- pred p(foo::in(bound(foo(bound(bar)))), foo::in(bound(foo(bound(bar)))))
is det.
p(X, X).
:- pred q(bar::in(bound(bar)), bar::in(bound(bar))) is det.
q(X, X).