Return a dynamic array: real bug!

Derek Parnell derek at psych.ward
Wed Jul 4 04:59:55 PDT 2007


On Wed, 04 Jul 2007 07:47:19 -0400, Gilles G. wrote:

> This doesn't compile, and this is _normal_:
> int[] test()
> {
>     int a[2];
>     return a;
> }
> But this does compile and should obviously not!
> int[] test()
> in{}
> out{}
> body
> {
>     int a[2];
>     return a;
> }
> 
> Therefore, there _is_ a problem with in/out/body.

Agreed. In fact its the 'out' that's the problem.

This doesn't compile ...

int[] test()
in{}
//out{}
body
{
    int a[2];
    return a;
}

-- 
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell


More information about the Digitalmars-d-learn mailing list