[Issue 6868] New: IsExp + incorrect static array type = error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 30 14:17:55 PDT 2011


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

           Summary: IsExp + incorrect static array type = error
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2011-10-30 14:16:42 PDT ---
Code:
----
@property bool empty(T)(in T[] a) @safe pure nothrow
{
    return !a.length;
}

void main()
{
    alias int[] Range;
    static if (is(char[1 + Range.empty]))  // Line 9
        enum bool isInfinite = true;

    char[0] s;  // need
}

Output:
----
test.d(9): Error: Integer constant expression expected instead of cast(uint)(1
+ cast(int)empty((__error)))

-- 
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