Confusing "Error: only one index allowed to index [...]"

Bastiaan Veelo Bastiaan at Veelo.net
Wed Jan 2 23:43:04 UTC 2019


On Wednesday, 2 January 2019 at 23:37:17 UTC, Bastiaan Veelo 
wrote:
> On Wednesday, 2 January 2019 at 22:49:45 UTC, Steven 
> Schveighoffer wrote:
>> What is happening is the compiler is evaluating expressions:
>>
>> a[1] resolves just fine, because of the int[] alias this. But 
>> then you are trying to index the result, which is an int.
>
> Indeed, this is one of the things I described :-)
>
>> So no, this error cannot be improved, [...]
>
> I think yes, because the message is: “Error: only one index 
> allowed to index `int`“ whereas it should be “Error: cannot 
> index type `int`“. Right?
>
> Bastiaan.

Which is the bug that Dennis reported. 
https://issues.dlang.org/show_bug.cgi?id=19534


More information about the Digitalmars-d mailing list