http://d.puremagic.com/issues/show_bug.cgi?id=6940

           Summary: immutable(int*)* and int** do not combine
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2011-11-12 13:34:54 PST ---
immutable(int*)* and int** do not combine even though const(int*)* would be a
common type:

immutable(int*)*    x;
int**               y;

static assert(is(typeof(x) : const(int*)*)); // ok
static assert(is(typeof(y) : const(int*)*)); // ok
static assert(is(typeof(1?x:y)));            // fail


Compare to dynamic arrays:

immutable(int[])[]  a;
int[][]             b;

static assert(is(typeof(a) : const(int[])[])); // ok
static assert(is(typeof(b) : const(int[])[])); // ok
static assert(is(typeof(1?a:b)));              // ok

(why on earth do the two cases use different logic?)

Therefore the following could be used as a workaround:

static assert(is(typeof((1?x[0..1]:y[0..1]).ptr)));

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to