www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6868] New: IsExp + incorrect static array type = error

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: k.hara.pg gmail.com



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: -------
Oct 30 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6868




Original code:
----
import std.range;
void main()
{
    pragma(msg, isInfinite!(int[]));

    char[0] s;  // need
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 30 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6868


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
           Severity|normal                      |major



https://github.com/D-Programming-Language/dmd/pull/482

And change importance: normal -> major
In my opinion, this issue is important, because std.range.isInfinite is used
frequently.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 30 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6868


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



00:25:52 PST ---
https://github.com/D-Programming-Language/dmd/commit/de0368bdad0df70122a055284ddc55fbf22f4be7

https://github.com/D-Programming-Language/dmd/commit/02dff8cf67356ca36cbb363c36665073a96e2099

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