January 24, 2017 test.d(22): Error: cannot append type test.Path to type test.Path | ||||
---|---|---|---|---|
| ||||
test.d(22): Error: cannot append type test.Path to type test.Path This is due to the changing some code that was appending. Obviously we can't append a type to itself. Would be nice if the error message was more clear like: Type test.Path is not an array. Cannot append to itself. |
January 25, 2017 Re: test.d(22): Error: cannot append type test.Path to type test.Path | ||||
---|---|---|---|---|
| ||||
Posted in reply to Profile Anaysis | On Tue, 24 Jan 2017 23:39:40 +0000, Profile Anaysis wrote:
> test.d(22): Error: cannot append type test.Path to type test.Path
>
> This is due to the changing some code that was appending. Obviously we can't append a type to itself.
You *can* append a type to itself:
struct Path
{
Path opBinary(string op)(ref const Path other) if (op == "~")
{
return Path.init;
}
}
Path a, b;
Path c = a ~ b;
That's why the error message isn't clearer.
|
Copyright © 1999-2021 by the D Language Foundation