Human stupidity or is this a regression?

Lionello Lunesu lionello at lunesu.remove.com
Wed Dec 25 21:39:28 PST 2013


On 12/26/13, 11:58, bearophile wrote:
> Lionello Lunesu:
>
>> I could have sworn this used to work. Is my memory failing me, or was
>> this a deliberate change at some point? Perhaps a regression?
>
> It's not a regression, it's a locked-in design mistake. Write it like
> this and try again:
>
> foreach (dchar d; "你好")
>
> Bye,
> bearophile

Yeah, that's what I ended up doing. But D being D, the default should be 
safe and correct.

I feel we could take this breaking change since it would not silently 
change the code to do something else. You'll get prompted and we could 
special case the error message to give a meaningful hint.

L


More information about the Digitalmars-d-learn mailing list