Files
mercury/tests/submodules/direct_arg_parent.m
Zoltan Somogyi eb6617c175 Rename X's aux modules as X_helper_N in submodules.
tests/submodules/*.m:
    Rename modules as mentioned above.

    Indent nested submodules to make them stand out.

    Group foreign_procs by what predicate they implement, not by
    their implementation language.

tests/submodules/*.m:
tests/submodules/*.err_exp:
tests/submodules/Mmakefile:
tests/submodules/Mercury.options:
    Update all references to the moved modules.
2023-06-19 22:16:36 +02:00

41 lines
1.1 KiB
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
%
% Test potential problems with direct argument type representation and
% submodules.
:- module direct_arg_parent.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
%---------------------------------------------------------------------------%
%---------------------------------------------------------------------------%
:- implementation.
:- include_module direct_arg_parent.direct_arg_parent_helper_1.
:- import_module direct_arg_parent.direct_arg_parent_helper_1.
:- type maybe_foo
---> no
; not_possible(foo)
; forced(foo)
where direct_arg is [forced/1].
%---------------------------------------------------------------------------%
main(!IO) :-
M1 = not_possible(foo(one, 1)),
M2 = forced(foo(one, 2)),
direct_arg_parent_helper_1.write_maybe_foo(M1, !IO),
direct_arg_parent_helper_1.write_maybe_foo(M2, !IO).
:- func one = int.
:- pragma no_inline(one/0).
one = 1.