Thread overview
Auto classes and with()
Oct 06, 2004
Nick
Oct 07, 2004
Ben Hinkle
Oct 07, 2004
Nick
Oct 08, 2004
Thomas Kuehne
October 06, 2004
There is a problem with using with() statements on auto class variables. The following snippet fails to compile:

auto class Foo
{
}
October 07, 2004
Nick wrote:

> There is a problem with using with() statements on auto class variables. The following snippet fails to compile:
> 
> auto class Foo
> {
> }


did you forget something? I don't see a "with" anywhere.

Also, complete code example are better - why make the n people who try your code write the rest when you can write it once and save us all the effort? (plus it makes it more likely n>0)

-Ben
October 07, 2004
In article <ck279i$gl6$1@digitaldaemon.com>, Ben Hinkle says...
>
>Nick wrote:
>
>> There is a problem with using with() statements on auto class variables. The following snippet fails to compile:
>> 
>> auto class Foo
>> {
>> }
>
>
>did you forget something? I don't see a "with" anywhere.

Err.. sorry. The rest must have been cut out somehow. We try again:

# auto class Foo
# {
# }
#
# void main()
# {
#   auto Foo f = new Foo;
#
#   with(f)
#     {
#     }
# }

Compiling gives:
tst.d(9): variable __withSym reference to auto class must be auto

Nick


October 08, 2004
Nick schrieb:
> # auto class Foo
> # {
> # }
> #
> # void main()
> # {
> #   auto Foo f = new Foo;
> #
> #   with(f)
> #     {
> #     }
> # }
>
> Compiling gives:
> tst.d(9): variable __withSym reference to auto class must be auto

added to dstress:
svn://svn.kuehne.cn/dstress/run/with_11.d

Thomas