mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-05-01 01:04:43 +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.
37 lines
667 B
Mathematica
37 lines
667 B
Mathematica
% Test overloading resolution for cross-module optimization.
|
|
:- module intermod_test.
|
|
:- interface.
|
|
|
|
:- import_module int.
|
|
|
|
:- pred p(int::out) is semidet.
|
|
|
|
:- type t
|
|
---> f(int)
|
|
; g.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module intermod_test2.
|
|
|
|
:- pragma inline(p/1).
|
|
p(X) :-
|
|
Y = f(1),
|
|
Y = f(_),
|
|
Lambda = (pred(Z::int_mode) is det :- Z = 2),
|
|
local(Lambda, X),
|
|
intermod_test2__baz(X).
|
|
|
|
:- mode int_mode == out.
|
|
|
|
:- pred local(pred(int), int).
|
|
:- mode local(pred(int_mode) is det, out) is det.
|
|
|
|
local(Pred, Int) :- call(Pred, Int).
|
|
|
|
:- pred local_2(pred(int), int).
|
|
:- mode local_2(pred(int_mode) is det, out) is det.
|
|
|
|
local_2(Pred, plusone(Int)) :- call(Pred, Int).
|
|
|