mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-23 13:23:47 +00:00
We inadventently wrote out 'coerce' casts in .opt files as:
V_2 = 'coerce expression'(V_3).
In commit 233874403f, cast_type_to_string
was changed to return "coerce expression" instead of simply "coerce"
for a slight improvement in mode errors.
compiler/hlds_out_goal.m:
Don't use the result of cast_type_to_string when when writing out
coerce casts.
tests/hard_coded/Mercury.options:
tests/hard_coded/Mmakefile:
tests/hard_coded/coerce_opt.exp:
tests/hard_coded/coerce_opt.m:
tests/hard_coded/coerce_opt_2.m:
Add test case.
29 lines
656 B
Mathematica
29 lines
656 B
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- module coerce_opt.
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- pred main(io::di, io::uo) is det.
|
|
|
|
%-----------------------------------------------------------------------------%
|
|
|
|
:- implementation.
|
|
|
|
:- import_module list.
|
|
:- import_module type_desc.
|
|
|
|
:- import_module coerce_opt_2.
|
|
|
|
main(!IO) :-
|
|
Xs = [1, 2, 3],
|
|
io.print_line(type_of(Xs), !IO),
|
|
io.print_line(Xs, !IO),
|
|
|
|
Ys = to_list(Xs),
|
|
io.print_line(type_of(Ys), !IO),
|
|
io.print_line(Ys, !IO).
|