[Issue 9835] New: DynamicArrayTypeOf and isDynamicArray work inconsistently

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 30 06:48:12 PDT 2013


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

           Summary: DynamicArrayTypeOf and isDynamicArray work
                    inconsistently
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: tobias at pankrath.net


--- Comment #0 from Tobias Pankrath <tobias at pankrath.net> 2013-03-30 06:48:11 PDT ---
---
struct Wrapper { 
    int[] data;
    alias data this;
};

pragma(msg, DynamicArrayTypeOf!Wrapper) // int[]
pragma(msg, isDynamicArray!Wrapper) // false
---

There are two issues here: The first one is that DynamicArrayTypeOf and
isDynamicArray should work consistently that is, isDynamicArray!T should be
true if and only if DynamicArrayTypeOf!T yields a type.

Second according to TDPL alias this makes Wrapper a subtype of int[] and
isDynamicArray!Wrapper should be true or otherwise isDynamicArray is quite
useless as a template constraint like in std.array.popFront.

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


More information about the Digitalmars-d-bugs mailing list