mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 01:43:35 +00:00
tests/invalid/*.{m,err_exp}:
tests/misc_tests/*.m:
tests/mmc_make/*.m:
tests/par_conj/*.m:
tests/purity/*.m:
tests/stm/*.m:
tests/string_format/*.m:
tests/structure_reuse/*.m:
tests/submodules/*.m:
tests/tabling/*.m:
tests/term/*.m:
tests/trailing/*.m:
tests/typeclasses/*.m:
tests/valid/*.m:
tests/warnings/*.{m,exp}:
Make these tests use four-space indentation, and ensure that
each module is imported on its own line. (I intend to use the latter
to figure out which subdirectories' tests can be executed in parallel.)
These changes usually move code to different lines. For the tests
that check compiler error messages, expect the new line numbers.
browser/cterm.m:
browser/tree234_cc.m:
Import only one module per line.
tests/hard_coded/boyer.m:
Fix something I missed.
55 lines
1.5 KiB
Mathematica
55 lines
1.5 KiB
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
%
|
|
% Regression test. When lambdas are turned into separate predicates, the
|
|
% non-local sets in the procedure may change, which in turn requires that
|
|
% instmaps be updated. We didn't do that, and the compiler aborted with:
|
|
%
|
|
% Uncaught Mercury exception:
|
|
% Software Error: map.lookup: key not found
|
|
% Key Type: term.var(parse_tree.prog_data.prog_var_type)
|
|
% Key Value: var(23)
|
|
% Value Type: ll_backend.var_locn.var_state
|
|
|
|
:- module lambda_instmap_bug2.
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- pred main(io::di, io::uo) is det.
|
|
|
|
%---------------------------------------------------------------------------%
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- implementation.
|
|
|
|
main(!IO) :-
|
|
mkthing(Thing),
|
|
docall(
|
|
% Must be lambda.
|
|
(pred(1::out, !.T::in, !:T::out) is det),
|
|
R, Thing, _Thing),
|
|
io.write(R, !IO),
|
|
io.nl(!IO).
|
|
|
|
:- type thing ---> thing.
|
|
|
|
:- typeclass tc1(T) where [].
|
|
:- typeclass tc2(T) where [].
|
|
|
|
:- instance tc1(thing) where [].
|
|
:- instance tc2(thing) where [].
|
|
|
|
:- some [T] pred mkthing(T::out) => (tc1(T), tc2(T)).
|
|
:- pragma no_inline(mkthing/1).
|
|
|
|
mkthing(thing).
|
|
|
|
:- pred docall((pred(int, T, T)::in(pred(out, in, out) is det)),
|
|
int::out, T::in, T::out) is det.
|
|
:- pragma no_inline(docall/4).
|
|
|
|
docall(P, R, !T) :-
|
|
P(R, !T).
|