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

Mehrdad wfunction at hotmail.com
Tue Aug 9 21:53:55 PDT 2011


On 8/8/2011 11:08 PM, Simen Kjaeraas wrote:
> 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.
>
Hm... at the very least, though, the compiler should generate a bug. 
Otherwise 'scope' becomes useless like 'inline'.


More information about the Digitalmars-d mailing list