[Issue 17635] [REG 2.066.0] cannot convert unique immutable(int)** to immutable

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 5 00:54:14 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=17635

David Nadlinger <code at klickverbot.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code at klickverbot.at

--- Comment #5 from David Nadlinger <code at klickverbot.at> ---
After a quick glance, I'm not sure whether this is indeed what is at fault
here. If it was indeed getIndirection() that was at fault, shouldn't it then
also be used to decompose aggregate members in traverseIndirections? In other
words, wouldn't returning struct { T** } (or struct{ struct { T** } }, etc.)
instead of T** still falsely trip.

If I were to guess, I would say that traverseIndirections() is missing a
condition that returns false if the constness of the outermost layers is not
compatible instead of continuing to decompose the pointer types. That is, T*
and const(T*) should be regarded as a definite non-match, irrespective of what
T is. It seems like the previous `ta->immutableOf()->equals(tb->immutableOf())`
check did that, but with false positives.

--


More information about the Digitalmars-d-bugs mailing list