Scoped local variables

Denton Cockburn diboss at hotmail.com
Fri Dec 7 11:45:43 PST 2007


On Fri, 07 Dec 2007 09:52:07 -0500, Jason House wrote:

> I'm having my code crash when I add in scope variables.  While it works
> in some cases, it doesn't in others.  I've whittled down my current
> problem to code that looks like:
> 
> unittest{
>   scope T t = new T();
> }
> 
> "T" has a bunch of arrays that it allocates and fills when it's
> constructed.  I'm currently confused how this code would cause a crash. 
> Any insights would be much appreciated.

Need more information.
What's the message given when it crashes?
Is the cause of the crash the fact that it's scoped?  Have you tried 
without scope?  Are you sure it's not in the constructor of T?


More information about the Digitalmars-d-learn mailing list