<?xml version="1.0"?>
<form>
<bugnb>
1366
</bugnb>
<subject>
the name of the return value is in scope of the function body
</subject>
<description>
when returning a Type (r:Integer), then r can be accessed from inside the function body.

Examining the "minimal program demonstrating the bug", it turns out, that though the file is compilable, but piping the return value of "foo(3)" into stdout causes a segfault.

defining the function in interactive mode of aldor, one sees the return value of "foo(i)". On my system this gives:
foo(0) -> segfault
foo(1) -> segfault
foo(2) -> 170
foo(3) -> 170
...
foo(9) -> 170
foo(10) -> segfault
foo(11) -> segfault
...

on the system of Ralf Hemmecke, with whom I talked about this behaviour, the return value of "foo(i)" depends strictly on the number of digits of i. So it had been constant for i's with the same number of digits.
</description>
<workaround>
dk
</workaround>
<wadescr>

</wadescr>
<priority>
2
</priority>
<bugfile>
/aldor.org/website/bugs/bugreport_1366/bugReturn.as
</bugfile>
<cmdline>
aldor -ginterp bugReturn.as
</cmdline>
<version>
1.0.1
</version>
<email>
christian.aistleitner@gmx.at
</email>
<inform>
yes
</inform>
<design>
no
</design>
<typeinf>
dk
</typeinf>
<parsing>
dk
</parsing>
<memory>
dk
</memory>
<optimlvl>
Q0
</optimlvl>
<libaldor>
no
</libaldor>
<algebra>
no
</algebra>
</form>
