mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-25 06:14:18 +00:00
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.
18 lines
479 B
Mathematica
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).
|
|
|