Nested function bug?

Walter Bright newshound2 at digitalmars.com
Fri Mar 30 13:45:41 PDT 2012


On 3/30/2012 1:13 PM, Ed McCardell wrote:
>
> I ran into a strange and hard-to-describe problem with nested functions closing
> over the argument to their enclosing function.
>
> When a nested function (A) returns the value of another nested function (B) that
> returns a parameter of the enclosing function (C), and when (A) is returned from
> (C), then calling (A) returns an incorrect value if (A) has a parameter of class
> type (it works when (A) has no class parameters).
>
> The code below demonstrates this (using DMD 2.058, no optimizations). Is this a
> bug?

Looks like one. Please report this to

http://d.puremagic.com/issues/enter_bug.cgi?product=D


More information about the Digitalmars-d mailing list