When D feels unfinished: union initialization and NRVO

drug drug2004 at bk.ru
Fri Mar 20 10:43:48 UTC 2020


On 3/19/20 11:59 PM, H. S. Teoh wrote:
> On Thu, Mar 19, 2020 at 08:09:44PM +0000, Kagamin via Digitalmars-d wrote:
>> On Thursday, 19 March 2020 at 18:46:13 UTC, H. S. Teoh wrote:
>>> Lifetime analysis is either going to break down or become seriously
>>> convoluted, if you try to apply it here!
>>
>> case Good.Baguette:
>>    if(true){
>>      Foo f = { type_: type, f1: typeof(Foo.f1)("Hello World") };
>>      return f;
>>    }
>>
>> Pretty sure if statement must be a self-contained scope, but even it
>> doesn't reset scope here.
> 
> That sounds like a bug, similar to the bug with identically-named
> local identifiers in disjoint subscopes in a function body.
> 

Today I can't understand compiler output and then remember this post. 
That bug makes using subscopes useless.



More information about the Digitalmars-d mailing list