www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Auto classes and with()

reply Nick <Nick_member pathlink.com> writes:
There is a problem with using with() statements on auto class variables. The
following snippet fails to compile:

auto class Foo
{
}
Oct 06 2004
parent reply Ben Hinkle <bhinkle4 juno.com> writes:
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
Oct 06 2004
parent reply Nick <Nick_member pathlink.com> writes:
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
Oct 07 2004
parent "Thomas Kuehne" <eisvogel users.sourceforge.net> writes:
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
Oct 08 2004