mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-23 21:33:49 +00:00
compiler/typecheck_clauses.m:
When typechecking coerce expressions, don't call
type_assign_fresh_type_var a second time for the same variable.
tests/invalid/Mmakefile:
tests/invalid/coerce_same_var.err_exp:
tests/invalid/coerce_same_var.m:
Add test case.
19 lines
448 B
Mathematica
19 lines
448 B
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- module coerce_same_var.
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- pred main(io::di, io::uo) is det.
|
|
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- implementation.
|
|
|
|
main(!IO) :-
|
|
X = coerce(X),
|
|
io.print_line(X, !IO).
|