mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-18 10:53:40 +00:00
Estimated hours taken: 0.1 tests/valid/intermod_lambda2.m tests/valid/intermod_test2.m Remove some mode errors which were not detected because mode analysis was never run - only `.opt' files are produced for these modules.
32 lines
562 B
Mathematica
32 lines
562 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.
|
|
|
|
:- mode int_mode :: in.
|
|
|
|
|
|
baz(X) :- T = f(1), bar(T, X).
|
|
|
|
:- pred bar(t::in, int::int_mode) is semidet.
|
|
|
|
bar(T, 2) :- T = f(1).
|
|
|
|
% 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 is Int0 + 1.
|
|
|