foreach on a tuple using aliases

Steven Schveighoffer schveiguy at gmail.com
Mon Aug 6 12:37:30 UTC 2018


On 8/5/18 11:40 AM, Timon Gehr wrote:
> On 05.08.2018 16:07, Steven Schveighoffer wrote:
>> So is this a bug? Is it expected?
> 
> It's a bug. The two copies of 'item' are not supposed to be the same 
> symbol. (Different types -> different symbols.)

Yep. I even found it has nothing to do with foreach on a tuple: 
https://run.dlang.io/is/vxQlIi

I wonder though, it shouldn't really be a different type that triggers 
it, right? I mean 2 separate aliases to different variables that are the 
same type, I would hope would re-instantiate. Otherwise something like 
.offsetof would be wrong.

> 
>> Is it too difficult to fix?
>> ...
> 
> Unlikely.

https://issues.dlang.org/show_bug.cgi?id=19145

-Steve


More information about the Digitalmars-d-learn mailing list