Confusing "Error: only one index allowed to index [...]"
Bastiaan Veelo
Bastiaan at Veelo.net
Wed Jan 2 23:37:17 UTC 2019
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.
More information about the Digitalmars-d
mailing list