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