[Dlang-internal] foreach + ref bug

Andrea Fontana nospam at example.com
Thu Jun 28 11:59:28 UTC 2018


On Thursday, 28 June 2018 at 10:39:21 UTC, ketmar wrote:
> Andrea Fontana wrote:
>
> it is all fairly easy, i fixed (workarounded) this bug in 
> Aliced long time ago[1]. patch is againd an older dmd, but it 
> should put you on the track.
>
>
> [1] http://dpaste.com/1SC0T6G

Thank you! Not that obvious for me, I've just started watching at 
dmd code.
Now the question is: should we accept foreach(ref) for non-ref 
ranges?

IMHO the right thing to do is to reject that code. I think this 
is going to brake a lot of existing phobos/user code so probably 
we should go through a deprecation process to have some time to 
fix all parts. And in this period we can use the workaround above.

What to do?

Andrea



More information about the Dlang-internal mailing list