mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-24 05:43:53 +00:00
Estimated hours taken: 2 Branches: main Replace deprecated mode and inst syntax in most of the test suite. TODO: Alter valid/mode_syntax.m when we start issuing warnings about the deprecated syntax. tests/*/*.m: Replace deprecated mode and inst syntax. Replace some uses of `:' as the module qualifier.
41 lines
802 B
Mathematica
41 lines
802 B
Mathematica
:- module intermod_test2.
|
|
|
|
:- interface.
|
|
|
|
:- import_module int.
|
|
:- pred baz(int::in) is semidet.
|
|
|
|
:- func plusone(int :: in) = (int :: out) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- type t
|
|
---> f(int)
|
|
; g(int1).
|
|
|
|
% Check that local types used only in other type declarations are put
|
|
% in the `.opt' file.
|
|
:- type int1 ---> int1(int).
|
|
|
|
:- mode int_mode == int_mode1.
|
|
:- mode int_mode1 == in.
|
|
|
|
baz(X) :- T = f(1), bar(T, X).
|
|
|
|
:- pred bar(t::in, int::int_mode) is semidet.
|
|
|
|
bar(T, 2) :-
|
|
Pred = (pred(T1::in, Int::int_mode) is semidet :-
|
|
T1 = f(1),
|
|
Int = 2
|
|
),
|
|
Pred(T, 2).
|
|
|
|
% One version of the compiler incorrectly wrote this declaration to
|
|
% the .opt file as `:- pragma inline((intermod_test2:plusone)/2).'
|
|
% -- bromage 20 Nov 1997
|
|
:- pragma inline(plusone/1).
|
|
|
|
plusone(Int0) = Int :- Int = Int0 + 1.
|
|
|