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. ;-)
(But there are indeed more problems with restricted types. I'll come back to them later.)
Frank