Files
mercury/tests/warnings/inf_recursion_lambda.m
Andrew Bromage b1629c5aa3 Fix to a bug where the compiler was spitting out incorrect warnings
Estimated hours taken: 1

Fix to a bug where the compiler was spitting out incorrect warnings
about infinite recursion when the recursive call was inside a lambda.

compiler/simplify.m:
	Fix detailed above.

tests/warnings/Mmake:
tests/warnings/inf_recursion_lambda.exp:
tests/warnings/inf_recursion_lambda.m:
	Test case.
1997-07-28 04:31:53 +00:00

18 lines
479 B
Mathematica

% This test case should produce _no_ warnings. One version of the
% compiler complained that the recursive call to return_me inside
% the lambda would call infinite recursion.
% -- 28/7/1997 bromage
:- module inf_recursion_lambda.
:- interface.
:- type closure ---> closure((func) = closure).
:- inst closure = bound(closure((func) = out(closure) is det)).
:- func return_me = (closure :: out(closure)) is det.
:- implementation.
return_me = closure((func) = return_me).