Discussion Thread: DIP 1039--Static Arrays with Inferred Length--Community Review Round 1

Dukc ajieskola at gmail.com
Fri Jan 8 14:02:03 UTC 2021


On Friday, 8 January 2021 at 12:43:51 UTC, Luhrel wrote:
> On Friday, 8 January 2021 at 11:49:30 UTC, Dukc wrote:
>> On Thursday, 7 January 2021 at 15:58:24 UTC, Luhrel wrote:
>>> [...]
>>
>> It does not compile because length of `s` is not known at 
>> compile time. It SHOULD compile if `s` was either a static 
>> array or a manifest constant, but currently it does not - what 
>> a lucky bug!
>>
>> I still think it deserves a mention -it's standard practice to 
>> put the "breaking changes" section even if there are none. In 
>> this case it seems a breaking change by the spec, but not by 
>> the implementation.
>
> Currently, isn't `$` only allowed inside the square brackets ?
> https://dlang.org/spec/arrays.html#array-length
>
> I don't think this bug is valid

Yes, and it is inside square brackets - just not as the top-level 
expression. But no-one claimed it has to be top-level.


More information about the Digitalmars-d-announce mailing list