Frank Heckenbach wrote:
Emil Jerabek wrote:
The problem with functional parameters seems to be more general, there is nothing special with restricted types. For example, the following program is also incorrect, and accepted by GPC:
program prog; type a=0..5; var c:a; procedure foo(function bar:integer); begin end; function baz:a; begin baz := c end; begin foo(baz) end .
Here the problem was simply that results of functional parameters weren't checked strictly enough, which is easy to fix. (Attached -- unfortunately, not all fixes are so self-explaining. ;-)
How is it incorrect? a being a subrange of integer, baz seems to satisfy the requirements for a parameter of foo. At least as I see it.