Question re specific implicit type coercion

Don Allen donaldcallen at gmail.com
Mon Oct 18 17:11:58 UTC 2021


On Monday, 18 October 2021 at 15:58:35 UTC, Don Allen wrote:
> On Monday, 18 October 2021 at 15:34:45 UTC, Paul Backus wrote:
>> On Monday, 18 October 2021 at 15:04:11 UTC, Don Allen wrote:
>>> Section 12.17 of the Language Reference does not indicate any 
>>> circumstance in which a dynamic array, which the literal is, 
>>> is implicitly coerced to a pointer.
>>
>> This is a special case for string literals, covered in 
>> [section 10.23.7][1].
>>
>> [1]: https://dlang.org/spec/expression.html#string_literals
>
> Yes. Thank you.

I do think it would be helpful, even essential, to have a link in 
Section 12.17 to the section you cite. The Language Reference is 
just that, a reference, not a tutorial and it should not be a 
requirement to read it from cover to cover. Strings and string 
literals are arrays and 12.17 purports to cover the implicit type 
conversions among the various array types, but currently leaves 
out this special case and should not, in my opinion. I will file 
an issue making this suggestion.


More information about the Digitalmars-d-learn mailing list