Not initialized out argument error

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 17 09:00:17 PDT 2014


On Tue, 17 Jun 2014 15:27:16 +0200
Timon Gehr via Digitalmars-d <digitalmars-d at puremagic.com> wrote:

> On 06/17/2014 02:02 AM, Walter Bright wrote:
> > On 6/16/2014 3:51 PM, bearophile wrote:
> >> test.d(1,21): Error: uninitialised out argument of 'test3.foo'
> >> function
> >
> > But it is not uninitialized. All out parameters are default
> > initialized to their .init value.
>
> struct S{ @disable this(); }
>
> void foo(out S s){} // ?

That shouldn't compile, because S doesn't have an init property. It's just one
of the features that stops working when init is disabled.

- Jonathan M Davis


More information about the Digitalmars-d mailing list