[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 02:07:41 UTC 2017


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

--- Comment #7 from Walter Bright <bugzilla at digitalmars.com> ---
The trouble with the getIndirection() is that passing a type:

  int*

and:

  struct S { int* p; }

behave differently. The first passes 'int' to traverseIndirections(), losing
the *, the second passes 'S', keeping the *.

There's just no way to make that work consistently. Kenji had papered it over,
which created the bug ag0ep6g found. But when I fixed that one, then this one
(from testInference.d) started passing when it should fail:

  struct S2 { const(int)* ptr; }
  immutable(S2) foo2b(const int*[] prm) pure { S2 s; return s; }

I can't make both work because of the getIndirection() inconsistency.

--


More information about the Digitalmars-d-bugs mailing list