|
Archives
D Programming
digitalmars.Ddigitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger D.gnu D C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D.learn - Escaped scoped
If I compile the following code with DMD with and without the scope annotation
I can see that both versions compile and the version with scope deletes the
object. Is the compiler acting correctly here? I'd like the compiler to refuse
to compile this code when the scope attribute is present (this is a reduced
example from a bug I've just removed from a program of mine):
class Foo {}
class Bar {
Foo x;
void spam() {
scope Foo temp = new Foo();
this.x = temp;
}
}
void main() {}
Bye,
bearophile
Jan 04 2010
On Mon, 04 Jan 2010 05:52:19 -0500, bearophile <bearophileHUGS lycos.com> wrote: Jan 04 2010
Steven Schveighoffer wrote:On Mon, 04 Jan 2010 05:52:19 -0500, bearophile <bearophileHUGS lycos.com> wrote: Jan 04 2010
Steven Schveighoffer wrote:On Mon, 04 Jan 2010 14:33:24 -0500, Don <nospam nospam.com> wrote:Steven Schveighoffer wrote:On Mon, 04 Jan 2010 05:52:19 -0500, bearophile <bearophileHUGS lycos.com> wrote: Jan 04 2010
On Mon, 04 Jan 2010 14:33:24 -0500, Don <nospam nospam.com> wrote:Steven Schveighoffer wrote:On Mon, 04 Jan 2010 05:52:19 -0500, bearophile <bearophileHUGS lycos.com> wrote: Jan 04 2010
|