Two bugs found: GC bug as well as scope delegate bug

Simen Kjaeraas simen.kjaras at gmail.com
Mon Aug 8 23:08:11 PDT 2011


On Tue, 09 Aug 2011 03:36:15 +0200, Mehrdad <wfunction at hotmail.com> wrote:

> On 8/8/2011 4:50 PM, Andrej Mitrovic wrote:
>> AFAIK it disallows you to escape a reference. `in` is actually const  
>> scope.
> So this heap allocation shouldn't be happening, right?

Yes and no. Disallowing that allocation would be an optimization not
required by the language. Essentially, 'scope' in the parameter list
is a limitation for the callee, not a guarantee for the caller.

-- 
   Simen


More information about the Digitalmars-d mailing list