convert static arrays to dynamic arrays and return, have wrong data.

AlanThinker via Digitalmars-d digitalmars-d at puremagic.com
Sun Nov 9 02:11:29 PST 2014


Is it possible to raise error when implicit convert static arrays 
to dynamic arrays?
Because there are really different.


On Sunday, 9 November 2014 at 10:04:16 UTC, bearophile wrote:
> AlanThinker:
>
>> It seems that, D's array is strange,
>> It can implicit convert static arrays to dynamic arrays no 
>> error and no warning.
>> But when I return the converted arrays out the function.
>> Outside function will get some wrong data.
>>
>> It may very easily cause some bug because no error when 
>> convert static arrays to dynamic arrays.
>
> Yeah, what do you suggest to change in the language to avoid 
> this problem?
>
> Bye,
> bearophile



More information about the Digitalmars-d mailing list